diff options
| author | cracker64 <cracker642@gmail.com> | 2013-03-01 05:41:53 (GMT) |
|---|---|---|
| committer | cracker64 <cracker642@gmail.com> | 2013-03-01 05:41:53 (GMT) |
| commit | 0d70547cf059b5bd0a7a4a0acd9251fb94c6115e (patch) | |
| tree | 99a0b212eeecee83662d963da052b439375acbf3 /src/simulation/elements/DSTW.cpp | |
| parent | 5873d6958641af21b92fcb039d26c336331f19e7 (diff) | |
| download | powder-0d70547cf059b5bd0a7a4a0acd9251fb94c6115e.zip powder-0d70547cf059b5bd0a7a4a0acd9251fb94c6115e.tar.gz | |
More fixes to fix fixes and new fixes to fix stuff.
Diffstat (limited to 'src/simulation/elements/DSTW.cpp')
| -rw-r--r-- | src/simulation/elements/DSTW.cpp | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/src/simulation/elements/DSTW.cpp b/src/simulation/elements/DSTW.cpp index 6c2c7d2..cca1b68 100644 --- a/src/simulation/elements/DSTW.cpp +++ b/src/simulation/elements/DSTW.cpp @@ -55,35 +55,46 @@ int Element_DSTW::update(UPDATE_FUNC_ARGS) if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) { r = pmap[y+ry][x+rx]; - if (!r) - continue; - rt = r&0xFF; - if (rt==PT_SALT && !(rand()%250)) - { - sim->part_change_type(i,x,y,PT_SLTW); - // on average, convert 3 DSTW to SLTW before SALT turns into SLTW - if (!(rand()%3)) - sim->part_change_type(r>>8,x+rx,y+ry,PT_SLTW); - } - if ((rt==PT_WATR||rt==PT_SLTW) && !(rand()%500)) - { - sim->part_change_type(i,x,y,PT_WATR); - } - if (rt==PT_SLTW && !(rand()%10000)) - { - sim->part_change_type(i,x,y,PT_SLTW); - } - if ((rt==PT_RBDM||rt==PT_LRBD) && (sim->legacy_enable||parts[i].temp>12.0f) && !(rand()%500)) + switch (r&0xFF) { - sim->part_change_type(i,x,y,PT_FIRE); - parts[i].life = 4; - } - if (rt==PT_FIRE){ + case PT_SALT: + if (!(rand()%250)) + { + sim->part_change_type(i,x,y,PT_SLTW); + // on average, convert 3 DSTW to SLTW before SALT turns into SLTW + if (!(rand()%3)) + sim->part_change_type(r>>8,x+rx,y+ry,PT_SLTW); + } + break; + case PT_SLTW: + if (!(rand()%10000)) + { + sim->part_change_type(i,x,y,PT_SLTW); + break; + } + case PT_WATR: + if (!(rand()%500)) + { + sim->part_change_type(i,x,y,PT_WATR); + } + break; + case PT_RBDM: + case PT_LRBD: + if ((sim->legacy_enable||parts[i].temp>12.0f) && !(rand()%500)) + { + sim->part_change_type(i,x,y,PT_FIRE); + parts[i].life = 4; + } + break; + case PT_FIRE: sim->kill_part(r>>8); if(!(rand()%150)){ sim->kill_part(i); return 1; } + break; + default: + continue; } } return 0; |
