From 6433eb04f2e9d01319a138980323bd56e4769acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Tue, 12 Dec 2023 19:47:14 +0100 Subject: [PATCH] Fix extremely rare pmap corruption c4dcb37de40e added a kill_part without a return 1. Reproduce with sim.loadSave(3062273, 1) sim.ensureDeterminism(true) tpt.setfpscap(2) local function F() print(sim.framerender(), sim.randomseed()) if sim.framerender() == 0 then local a = 2247503365 print(sim.hash(), a) sim.framerender(1200) sim.reloadSave() sim.randomseed(a, a + 1, a + 2, a + 3) tpt.set_pause(0) end end event.register(event.tick, F) --- src/simulation/elements/PROT.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/simulation/elements/PROT.cpp b/src/simulation/elements/PROT.cpp index 6dfa398c9..3575c2331 100644 --- a/src/simulation/elements/PROT.cpp +++ b/src/simulation/elements/PROT.cpp @@ -108,7 +108,10 @@ static int update(UPDATE_FUNC_ARGS) if (parts[i].life) { if (!--parts[i].life) + { sim->kill_part(i); + return 1; + } } break; default: