From 9fcf780c784e1f86647947dcc5af4967adc30359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Wed, 27 May 2020 08:42:49 +0200 Subject: [PATCH] Necromancy is bad This is very similar to the SPRK-PROT bug (fixed by 4aa58d6c) in that the cause for a later crash is the free list of particles being corrupted by messing with the .life property of a dead particle. The code in the loop body following this kill_part call has no effect on other particles if the call were to happen. The only thing this continue skips is increasing pressure under the now dead particle. Credit goes to @QuanTech for finding the problem, see id:2547788 (originally his save, I just saved to my alt account for future reference). --- src/simulation/elements/FIRE.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/simulation/elements/FIRE.cpp b/src/simulation/elements/FIRE.cpp index 30364f60e..3e0dd50cb 100644 --- a/src/simulation/elements/FIRE.cpp +++ b/src/simulation/elements/FIRE.cpp @@ -130,6 +130,7 @@ int Element_FIRE_update(UPDATE_FUNC_ARGS) if (parts[i].ctype == PT_IRON && RNG::Ref().chance(1, 500)) { parts[i].ctype = PT_METL; sim->kill_part(ID(r)); + continue; } } }