summaryrefslogtreecommitdiff
path: root/src/simulation/elements/CO2.cpp
diff options
context:
space:
mode:
authorcracker64 <cracker642@gmail.com>2013-02-28 17:37:16 (GMT)
committer cracker64 <cracker642@gmail.com>2013-02-28 17:37:16 (GMT)
commit5873d6958641af21b92fcb039d26c336331f19e7 (patch)
treea334e74d7cf79726f5c0a411515bed801ee0333f /src/simulation/elements/CO2.cpp
parentc65081d3ed44a97cea0f41a63e9ec07cf0feb5f2 (diff)
downloadpowder-5873d6958641af21b92fcb039d26c336331f19e7.zip
powder-5873d6958641af21b92fcb039d26c336331f19e7.tar.gz
Going through again.
Diffstat (limited to 'src/simulation/elements/CO2.cpp')
-rw-r--r--src/simulation/elements/CO2.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/simulation/elements/CO2.cpp b/src/simulation/elements/CO2.cpp
index c4e6a9a..09dbe8c 100644
--- a/src/simulation/elements/CO2.cpp
+++ b/src/simulation/elements/CO2.cpp
@@ -64,11 +64,14 @@ int Element_CO2::update(UPDATE_FUNC_ARGS)
return 1;
}
}
- if (((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW) && !(rand()%250))
+ else if (((r&0xFF)==PT_WATR || (r&0xFF)==PT_DSTW) && !(rand()%250))
{
sim->part_change_type(r>>8, x+rx, y+ry, PT_CBNW);
if (parts[i].ctype==5) //conserve number of water particles - ctype=5 means this CO2 hasn't released the water particle from BUBW yet
+ {
sim->create_part(i, x, y, PT_WATR);
+ return 0;
+ }
else
{
sim->kill_part(i);