summaryrefslogtreecommitdiff
path: root/src/simulation/Simulation.cpp
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2013-09-08 08:21:08 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2013-09-08 08:26:31 (GMT)
commit79edfe9589c4b82ce320e0ae88d043b66b14f570 (patch)
tree476541f19227f01da686f9462d9f5b3fda685a35 /src/simulation/Simulation.cpp
parent8d96f3f6b6a872956cac4217c4a8f56d6316738b (diff)
downloadpowder-79edfe9589c4b82ce320e0ae88d043b66b14f570.zip
powder-79edfe9589c4b82ce320e0ae88d043b66b14f570.tar.gz
Include elements[].Enabled in check for invalid lava ctype
Diffstat (limited to 'src/simulation/Simulation.cpp')
-rw-r--r--src/simulation/Simulation.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index 7d466a4..03c4dd2 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -3811,7 +3811,7 @@ void Simulation::update_particles_i(int start, int inc)
s = 1;
//A fix for ice with ctype = 0
- if ((t==PT_ICEI || t==PT_SNOW) && (parts[i].ctype==0 || parts[i].ctype>=PT_NUM || parts[i].ctype==PT_ICEI || parts[i].ctype==PT_SNOW))
+ if ((t==PT_ICEI || t==PT_SNOW) && (parts[i].ctype<=0 || parts[i].ctype>=PT_NUM || parts[i].ctype==PT_ICEI || parts[i].ctype==PT_SNOW || !elements[parts[i].ctype].Enabled))
parts[i].ctype = PT_WATR;
if (ctemph>elements[t].HighTemperature && elements[t].HighTemperatureTransition>-1)
@@ -3838,7 +3838,7 @@ void Simulation::update_particles_i(int start, int inc)
#endif
else if (t == PT_ICEI || t == PT_SNOW)
{
- if (parts[i].ctype < PT_NUM && parts[i].ctype != t)
+ if (parts[i].ctype > 0 && parts[i].ctype < PT_NUM && parts[i].ctype != t)
{
if (elements[parts[i].ctype].LowTemperatureTransition==t && pt<=elements[parts[i].ctype].LowTemperature)
s = 0;
@@ -3941,7 +3941,7 @@ void Simulation::update_particles_i(int start, int inc)
}
else if (t == PT_LAVA)
{
- if (parts[i].ctype>0 && parts[i].ctype<PT_NUM && parts[i].ctype!=PT_LAVA)
+ if (parts[i].ctype>0 && parts[i].ctype<PT_NUM && parts[i].ctype!=PT_LAVA && parts[i].ctype!=PT_LAVA && elements[parts[i].ctype].Enabled)
{
if (parts[i].ctype==PT_THRM&&pt>=elements[PT_BMTL].HighTemperature)
s = 0;