From c3b0a60aa48d1654d20f606ed4365bd3b7a57ab9 Mon Sep 17 00:00:00 2001 From: AllyTally Date: Tue, 22 Aug 2023 22:23:08 -0300 Subject: [PATCH] Only spawn activity zone if the script exists --- desktop_version/src/Map.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Map.cpp b/desktop_version/src/Map.cpp index a7649221..613ce2dd 100644 --- a/desktop_version/src/Map.cpp +++ b/desktop_version/src/Map.cpp @@ -1918,9 +1918,14 @@ void mapclass::loadlevel(int rx, int ry) } obj.createentity(ex, usethisy + 8, 20 + SDL_clamp(ent.p2, 0, 1), usethistile); - if (obj.customscript != "") + + for (size_t i = 0; i < script.customscripts.size(); i++) { - obj.createblock(ACTIVITY, ex - 8, usethisy + 8, 20, 16, 35); + if (script.customscripts[i].name == obj.customscript) + { + obj.createblock(ACTIVITY, ex - 8, usethisy + 8, 20, 16, 35); + break; + } } break; }