summaryrefslogtreecommitdiff
path: root/src/simulation/elements
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-20 12:55:11 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-20 12:55:11 (GMT)
commit29283b038c4c7966e656e38b3ff25574521b543d (patch)
tree19fa5aee911e791537112cfbcdb8466957b37688 /src/simulation/elements
parent7fc8d5f388039da885b3432cdfe7d5b7f4ace07c (diff)
downloadpowder-29283b038c4c7966e656e38b3ff25574521b543d.zip
powder-29283b038c4c7966e656e38b3ff25574521b543d.tar.gz
TPT: Consistent proportions of WATR and SALT in SLTW (1 SALT + 3 WATR = 4 SLTW)
Diffstat (limited to 'src/simulation/elements')
-rw-r--r--src/simulation/elements/SLTW.cpp2
-rw-r--r--src/simulation/elements/WATR.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/simulation/elements/SLTW.cpp b/src/simulation/elements/SLTW.cpp
index 7afdc26..c422a9f 100644
--- a/src/simulation/elements/SLTW.cpp
+++ b/src/simulation/elements/SLTW.cpp
@@ -58,7 +58,7 @@ int Element_SLTW::update(UPDATE_FUNC_ARGS)
if (!r)
continue;
if ((r&0xFF)==PT_SALT && 1>(rand()%10000))
- sim->kill_part(r>>8);
+ sim->part_change_type(r>>8,x+rx,y+ry,PT_SLTW);
if ((r&0xFF)==PT_PLNT&&5>(rand()%1000))
sim->kill_part(r>>8);
if (((r&0xFF)==PT_RBDM||(r&0xFF)==PT_LRBD) && !sim->legacy_enable && parts[i].temp>(273.15f+12.0f) && 1>(rand()%500))
diff --git a/src/simulation/elements/WATR.cpp b/src/simulation/elements/WATR.cpp
index ca3b926..bac8b68 100644
--- a/src/simulation/elements/WATR.cpp
+++ b/src/simulation/elements/WATR.cpp
@@ -61,7 +61,9 @@ int Element_WATR::update(UPDATE_FUNC_ARGS)
if ((r&0xFF)==PT_SALT && 1>(rand()%250))
{
sim->part_change_type(i,x,y,PT_SLTW);
- sim->part_change_type(r>>8,x+rx,y+ry,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 (((r&0xFF)==PT_RBDM||(r&0xFF)==PT_LRBD) && (sim->legacy_enable||parts[i].temp>(273.15f+12.0f)) && 1>(rand()%500))
{