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).
This commit is contained in:
Tamás Bálint Misius 2020-05-27 08:42:49 +02:00
parent dda7747688
commit 9fcf780c78
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2

View File

@ -130,6 +130,7 @@ int Element_FIRE_update(UPDATE_FUNC_ARGS)
if (parts[i].ctype == PT_IRON && RNG::Ref().chance(1, 500)) { if (parts[i].ctype == PT_IRON && RNG::Ref().chance(1, 500)) {
parts[i].ctype = PT_METL; parts[i].ctype = PT_METL;
sim->kill_part(ID(r)); sim->kill_part(ID(r));
continue;
} }
} }
} }