Fix for PUMP

This commit is contained in:
Simon Robertshaw 2012-05-11 17:58:25 +01:00
parent 0c8fae82c7
commit 835d6bbfb9

View File

@ -26,16 +26,13 @@ int update_PUMP(UPDATE_FUNC_ARGS) {
if (parts[i].temp<= -256.0+273.15)
parts[i].temp = -256.0+273.15;
if (pv[y/CELL][x/CELL]<(parts[i].temp-273.15))
pv[y/CELL][x/CELL] += 0.1f*((parts[i].temp-273.15)-pv[y/CELL][x/CELL]);
if (y+CELL<YRES && pv[y/CELL+1][x/CELL]<(parts[i].temp-273.15))
pv[y/CELL+1][x/CELL] += 0.1f*((parts[i].temp-273.15)-pv[y/CELL+1][x/CELL]);
if (x+CELL<XRES)
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if ((x+rx)-CELL>=0 && (y+ry)-CELL>0 && (x+rx)+CELL<XRES && (y+ry)+CELL<YRES && !(rx && ry))
{
pv[y/CELL][x/CELL+1] += 0.1f*((parts[i].temp-273.15)-pv[y/CELL][x/CELL+1]);
if (y+CELL<YRES)
pv[y/CELL+1][x/CELL+1] += 0.1f*((parts[i].temp-273.15)-pv[y/CELL+1][x/CELL+1]);
pv[(y/CELL)+ry][(x/CELL)+rx] += 0.1f*((parts[i].temp-273.15)-pv[(y/CELL)+ry][(x/CELL)+rx]);
}
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))