diff options
| author | jacob1 <jfu614@gmail.com> | 2013-10-10 21:13:11 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-10-10 21:13:11 (GMT) |
| commit | c4dcb37de40eda86871ba4e0992877528a208e39 (patch) | |
| tree | d81ab19f78b97e75ee84ea68da4e83fcb22ef982 /src/simulation/elements/PROT.cpp | |
| parent | d1e75c7a50629a7b3026aa078711713fb2a93e11 (diff) | |
| download | powder-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.cpp | 9 |
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) |
