From c7619387ace6a24c4bd31e6899073ef3a91bcf7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Fri, 5 Mar 2021 21:54:00 +0100 Subject: [PATCH] Fix EXOT freezing upon failing to replicate a neighbour --- src/simulation/elements/EXOT.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/simulation/elements/EXOT.cpp b/src/simulation/elements/EXOT.cpp index 315ccc785..331250906 100644 --- a/src/simulation/elements/EXOT.cpp +++ b/src/simulation/elements/EXOT.cpp @@ -101,8 +101,10 @@ static int update(UPDATE_FUNC_ARGS) if (parts[i].tmp > 245 && parts[i].life > 1337) if (rt!=PT_EXOT && rt!=PT_BREC && rt!=PT_DMND && rt!=PT_CLNE && rt!=PT_PRTI && rt!=PT_PRTO && rt!=PT_PCLN && rt!=PT_VOID && rt!=PT_NBHL && rt!=PT_WARP) { - sim->create_part(i, x, y, rt); - return 1; + if (sim->create_part(i, x, y, rt) != -1) + { + return 1; + } } } @@ -166,8 +168,10 @@ static int update(UPDATE_FUNC_ARGS) { if (parts[i].temp < 50.0f) { - sim->create_part(i, x, y, PT_CFLM); - return 1; + if (sim->create_part(i, x, y, PT_CFLM) != -1) // I don't see how this could fail but whatever + { + return 1; + } } else parts[i].temp -= 1.0f;