diff --git a/src/simulation/elements/ELEC.cpp b/src/simulation/elements/ELEC.cpp index f49d3a64cb..48029ace70 100644 --- a/src/simulation/elements/ELEC.cpp +++ b/src/simulation/elements/ELEC.cpp @@ -87,6 +87,7 @@ int Element_ELEC::update(UPDATE_FUNC_ARGS) sim->create_part(r>>8, x+rx, y+ry, PT_O2); else sim->create_part(r>>8, x+rx, y+ry, PT_H2); + sim->kill_part(i); return 1; case PT_PROT: // this is the correct reaction, not NEUT, but leaving NEUT in anyway if (parts[r>>8].tmp2 & 0x1) diff --git a/src/simulation/elements/FUSE.cpp b/src/simulation/elements/FUSE.cpp index 9eb5e376b1..ebec38dd0e 100644 --- a/src/simulation/elements/FUSE.cpp +++ b/src/simulation/elements/FUSE.cpp @@ -80,10 +80,10 @@ int Element_FUSE::update(UPDATE_FUNC_ARGS) r = pmap[y+ry][x+rx]; if (!r) continue; - if ((r&0xFF)==PT_SPRK || ((parts[i].temp>=(273.15+700.0f)) && parts[i].life>40 && !(rand()%20))) + if ((r&0xFF)==PT_SPRK || (parts[i].temp>=(273.15+700.0f) && !(rand()%20))) { - parts[i].life = 39; - + if (parts[i].life > 40) + parts[i].life = 39; } } return 0; diff --git a/src/simulation/elements/IRON.cpp b/src/simulation/elements/IRON.cpp index 5c0cdf6e60..83a236592a 100644 --- a/src/simulation/elements/IRON.cpp +++ b/src/simulation/elements/IRON.cpp @@ -50,6 +50,8 @@ Element_IRON::Element_IRON() int Element_IRON::update(UPDATE_FUNC_ARGS) { int r, rx, ry, rt; + if (!parts[i].life) + return 0; for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) if (BOUNDS_CHECK && (rx || ry)) @@ -58,19 +60,19 @@ int Element_IRON::update(UPDATE_FUNC_ARGS) switch (r&0xFF) { case PT_SALT: - if (!(parts[i].life) && !(rand()%47)) + if (!(rand()%47)) goto succ; break; case PT_SLTW: - if (!(parts[i].life) && !(rand()%67)) + if (!(rand()%67)) goto succ; break; case PT_WATR: - if (!(parts[i].life) && !(rand()%1200)) + if (!(rand()%1200)) goto succ; break; case PT_O2: - if (!(parts[i].life) && !(rand()%250)) + if (!(rand()%250)) goto succ; break; case PT_LO2: