From 77b47a3c7e9eba51dd4f029d66dbac027d10be3f Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 17 Aug 2020 12:08:32 -0700 Subject: [PATCH] Fix compatibility with levels that rely on gamestate-based script boxes Some levels rely specifically on the fact that certain script boxes are loaded using gamestates, instead of directly loading the script and bypassing the gamestate system. Then weird things could happen. This restores compatibility with those levels. mapclass::twoframedelayfix() doesn't need to be updated because the point of that function is to bypass the gamestate system entirely anyways. --- desktop_version/src/Entity.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index e06fbe92..b74bbaa8 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -4828,7 +4828,8 @@ void entityclass::entitycollisioncheck() int block_idx = -1; if (checktrigger(&block_idx) > -1 && block_idx > -1) { - if (blocks[block_idx].script != "") + // Load the block's script if its gamestate is out of range + if (blocks[block_idx].script != "" && (activetrigger < 300 || activetrigger > 336)) { game.startscript = true; game.newscript = blocks[block_idx].script;