summaryrefslogtreecommitdiff
path: root/src/simulation/elements/PROT.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-10-10 21:13:11 (GMT)
committer jacob1 <jfu614@gmail.com>2013-10-10 21:13:11 (GMT)
commitc4dcb37de40eda86871ba4e0992877528a208e39 (patch)
treed81ab19f78b97e75ee84ea68da4e83fcb22ef982 /src/simulation/elements/PROT.cpp
parentd1e75c7a50629a7b3026aa078711713fb2a93e11 (diff)
downloadpowder-c4dcb37de40eda86871ba4e0992877528a208e39.zip
powder-c4dcb37de40eda86871ba4e0992877528a208e39.tar.gz
PROT with 0 life doesn't die
Diffstat (limited to 'src/simulation/elements/PROT.cpp')
-rw-r--r--src/simulation/elements/PROT.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/simulation/elements/PROT.cpp b/src/simulation/elements/PROT.cpp
index 8cce54e..32b6907 100644
--- a/src/simulation/elements/PROT.cpp
+++ b/src/simulation/elements/PROT.cpp
@@ -31,7 +31,7 @@ Element_PROT::Element_PROT()
Description = "Protons. Transfer heat to materials, and removes sparks.";
State = ST_GAS;
- Properties = TYPE_ENERGY|PROP_LIFE_KILL;
+ Properties = TYPE_ENERGY;
LowPressure = IPL;
LowPressureTransition = NT;
@@ -107,8 +107,11 @@ int Element_PROT::update(UPDATE_FUNC_ARGS)
}
}
//else, slowly kill it if it's not inside an element
- else
- parts[i].life--;
+ else if (parts[i].life)
+ {
+ if (!--parts[i].life)
+ sim->kill_part(i);
+ }
//if this proton has collided with another last frame, change it into a heavier element
if (parts[i].tmp)