From c4dcb37de40eda86871ba4e0992877528a208e39 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Thu, 10 Oct 2013 17:13:11 -0400 Subject: [PATCH] PROT with 0 life doesn't die --- src/simulation/elements/PROT.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/simulation/elements/PROT.cpp b/src/simulation/elements/PROT.cpp index 8cce54eca..32b6907e9 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)