From 191b9891163cca810961883728f581889b2f2995 Mon Sep 17 00:00:00 2001 From: NyakoFox Date: Thu, 7 May 2026 20:05:19 -0300 Subject: [PATCH] Fix double script execution when entering playtesting `twoframedelayfix()` now gets called in `resetplayer` due to #1258, to fix the two-frame script delay when you respawn. Unfortunately, there seems to be some strange bug where starting playtesting in a script box activates the script twice. While I'm not exactly sure WHY this happens logic-wise, we can quickly squash this issue by checking if the player is reset due to dying. --- desktop_version/src/Map.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/Map.cpp b/desktop_version/src/Map.cpp index d72c4f12..8b728b77 100644 --- a/desktop_version/src/Map.cpp +++ b/desktop_version/src/Map.cpp @@ -791,7 +791,10 @@ void mapclass::resetplayer(const bool player_died) if (game.roomx != game.saverx || game.roomy != game.savery) { gotoroom(game.saverx, game.savery); - twoframedelayfix(); + if (player_died) + { + twoframedelayfix(); + } } int i = obj.getplayer();