diff options
| author | jacob1 <jfu614@gmail.com> | 2012-12-18 19:08:53 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2012-12-18 19:08:53 (GMT) |
| commit | 771d71ea4619f30bd1b135697e83037ba333008f (patch) | |
| tree | 81952978bc16b2418d5212b76b99054116c83b69 /src/simulation | |
| parent | e685e30d58f252ddca3dce0d67c3d2af56ce330d (diff) | |
| download | powder-771d71ea4619f30bd1b135697e83037ba333008f.zip powder-771d71ea4619f30bd1b135697e83037ba333008f.tar.gz | |
make water equalization use flags, not tmp2 (fixes EXOT / BUBW)
Diffstat (limited to 'src/simulation')
| -rw-r--r-- | src/simulation/Elements.h | 5 | ||||
| -rw-r--r-- | src/simulation/Simulation.cpp | 13 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/simulation/Elements.h b/src/simulation/Elements.h index 781a8f8..937b4cb 100644 --- a/src/simulation/Elements.h +++ b/src/simulation/Elements.h @@ -37,9 +37,10 @@ #define PROP_SPARKSETTLE 0x20000 //2^17 Allow Sparks/Embers to settle #define PROP_NOAMBHEAT 0x40000 //2^18 Don't transfer or receive heat from ambient heat. -#define FLAG_STAGNANT 1 +#define FLAG_STAGNANT 0x1 #define FLAG_SKIPMOVE 0x2 // skip movement for one frame, only implemented for PHOT -#define FLAG_MOVABLE 0x4 // if can move +#define FLAG_WATEREQUAL 0x4 +#define FLAG_MOVABLE 0x8 // if can move #define ST_NONE 0 #define ST_SOLID 1 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 |
