diff options
Diffstat (limited to 'src/simulation/Simulation.cpp')
| -rw-r--r-- | src/simulation/Simulation.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 6506141..1ac5d48 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -840,7 +840,10 @@ int Simulation::flood_water(int x, int y, int i, int originaly, int check) // fill span for (x=x1; x<=x2; x++) { - parts[pmap[y][x]>>8].tmp2 = !check;//flag it as checked, maybe shouldn't use .tmp2 + if (check) + parts[pmap[y][x]>>8].flags &= ~FLAG_WATEREQUAL;//flag it as checked (different from the original particle's checked flag) + else + parts[pmap[y][x]>>8].flags |= FLAG_WATEREQUAL; //check above, maybe around other sides too? if ( ((y-1) > originaly) && !pmap[y-1][x] && eval_move(parts[i].type, x, y-1, NULL)) { @@ -857,12 +860,12 @@ int Simulation::flood_water(int x, int y, int i, int originaly, int check) if (y>=CELL+1) for (x=x1; x<=x2; x++) - if ((elements[(pmap[y-1][x]&0xFF)].Falldown)==2 && parts[pmap[y-1][x]>>8].tmp2 == check) + if ((elements[(pmap[y-1][x]&0xFF)].Falldown)==2 && (parts[pmap[y-1][x]>>8].flags & FLAG_WATEREQUAL) == check) if (!flood_water(x, y-1, i, originaly, check)) return 0; if (y<YRES-CELL-1) for (x=x1; x<=x2; x++) - if ((elements[(pmap[y+1][x]&0xFF)].Falldown)==2 && parts[pmap[y+1][x]>>8].tmp2 == check) + if ((elements[(pmap[y+1][x]&0xFF)].Falldown)==2 && (parts[pmap[y+1][x]>>8].flags & FLAG_WATEREQUAL) == check) if (!flood_water(x, y+1, i, originaly, check)) return 0; return 1; @@ -3693,7 +3696,7 @@ void Simulation::update_particles_i(int start, int inc) pGravY += gravy[(y/CELL)*(XRES/CELL)+(x/CELL)]; } //velocity updates for the particle - if (!(parts[i].flags&FLAG_MOVABLE)) + if (t != PT_SPNG || !(parts[i].flags&FLAG_MOVABLE)) { parts[i].vx *= elements[t].Loss; parts[i].vy *= elements[t].Loss; @@ -4373,7 +4376,7 @@ killed: { if (water_equal_test && elements[t].Falldown == 2 && 1>= rand()%400)//checking stagnant is cool, but then it doesn't update when you change it later. { - if (!flood_water(x,y,i,y, parts[i].tmp2)) + if (!flood_water(x,y,i,y, parts[i].flags&FLAG_WATEREQUAL)) goto movedone; } // liquids and powders |
