summaryrefslogtreecommitdiff
path: root/src/simulation/elements/WATR.cpp
diff options
context:
space:
mode:
authorcracker64 <cracker642@gmail.com>2013-02-28 05:40:36 (GMT)
committer cracker64 <cracker642@gmail.com>2013-02-28 05:40:36 (GMT)
commitc65081d3ed44a97cea0f41a63e9ec07cf0feb5f2 (patch)
tree90744a56bc618c12aab5ef617445b283ce2d6d57 /src/simulation/elements/WATR.cpp
parent08d1a68ce091b6ba53788224fd1bda92c1895ca6 (diff)
downloadpowder-c65081d3ed44a97cea0f41a63e9ec07cf0feb5f2.zip
powder-c65081d3ed44a97cea0f41a63e9ec07cf0feb5f2.tar.gz
Finished first pass-through for all elements.
Will get a few more places later.
Diffstat (limited to 'src/simulation/elements/WATR.cpp')
-rw-r--r--src/simulation/elements/WATR.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/simulation/elements/WATR.cpp b/src/simulation/elements/WATR.cpp
index f0fde66..513ab60 100644
--- a/src/simulation/elements/WATR.cpp
+++ b/src/simulation/elements/WATR.cpp
@@ -57,22 +57,22 @@ int Element_WATR::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
- if ((r&0xFF)==PT_SALT && 1>(rand()%250))
+ if ((r&0xFF)==PT_SALT && !(rand()%250))
{
sim->part_change_type(i,x,y,PT_SLTW);
// on average, convert 3 WATR to SLTW before SALT turns into SLTW
- if (rand()%3==0)
- sim->part_change_type(r>>8,x+rx,y+ry,PT_SLTW);
+ if (!(rand()%3))
+ sim->part_change_type(r>>8,x+rx,y+ry,PT_SLTW);
}
- if (((r&0xFF)==PT_RBDM||(r&0xFF)==PT_LRBD) && (sim->legacy_enable||parts[i].temp>(273.15f+12.0f)) && 1>(rand()%500))
+ else if (((r&0xFF)==PT_RBDM||(r&0xFF)==PT_LRBD) && (sim->legacy_enable||parts[i].temp>(273.15f+12.0f)) && !(rand()%500))
{
sim->part_change_type(i,x,y,PT_FIRE);
parts[i].life = 4;
parts[i].ctype = PT_WATR;
}
- if ((r&0xFF)==PT_FIRE && parts[r>>8].ctype!=PT_WATR){
+ else if ((r&0xFF)==PT_FIRE && parts[r>>8].ctype!=PT_WATR){
sim->kill_part(r>>8);
- if(1>(rand()%150)){
+ if(!(rand()%150)){
sim->kill_part(i);
return 1;
}