summaryrefslogtreecommitdiff
path: root/src/simulation/elements/ICEI.cpp
diff options
context:
space:
mode:
authorcracker64 <cracker642@gmail.com>2013-02-27 17:08:10 (GMT)
committer cracker64 <cracker642@gmail.com>2013-02-27 17:08:10 (GMT)
commit3d2e59415003c51c0b6dbe764003cc2012ba9ca7 (patch)
tree98bf2347be2a5ada02c4a2297b3e1c88acf72e21 /src/simulation/elements/ICEI.cpp
parent27e3e1251837f5d64e835068d5f5bd5b67b95921 (diff)
downloadpowder-3d2e59415003c51c0b6dbe764003cc2012ba9ca7.zip
powder-3d2e59415003c51c0b6dbe764003cc2012ba9ca7.tar.gz
Small modifications part three.
Diffstat (limited to 'src/simulation/elements/ICEI.cpp')
-rw-r--r--src/simulation/elements/ICEI.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/simulation/elements/ICEI.cpp b/src/simulation/elements/ICEI.cpp
index 3624877..995da9e 100644
--- a/src/simulation/elements/ICEI.cpp
+++ b/src/simulation/elements/ICEI.cpp
@@ -61,16 +61,18 @@ int Element_ICEI::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
- if (((r&0xFF)==PT_SALT || (r&0xFF)==PT_SLTW) && parts[i].temp > sim->elements[PT_SLTW].LowTemperature && 1>(rand()%1000))
+ if (((r&0xFF)==PT_SALT || (r&0xFF)==PT_SLTW) && parts[i].temp > sim->elements[PT_SLTW].LowTemperature && !(rand()%1000))
{
sim->part_change_type(i,x,y,PT_SLTW);
sim->part_change_type(r>>8,x+rx,y+ry,PT_SLTW);
+ goto done;
}
- if (((r&0xFF)==PT_FRZZ) && (parts[i].ctype=PT_FRZW) && 1>(rand()%1000))
- sim->part_change_type(r>>8,x+rx,y+ry,PT_ICEI);
+ else if (((r&0xFF)==PT_FRZZ) && (parts[i].ctype=PT_FRZW) && !(rand()%1000))
+ sim->part_change_type(r>>8,x+rx,y+ry,PT_ICEI);
}
+ done:
return 0;
}
-Element_ICEI::~Element_ICEI() {} \ No newline at end of file
+Element_ICEI::~Element_ICEI() {}