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.
This commit is contained in:
NyakoFox
2026-05-07 20:05:19 -03:00
committed by Ethan Lee
parent c02f8e004c
commit 191b989116
+3
View File
@@ -791,8 +791,11 @@ void mapclass::resetplayer(const bool player_died)
if (game.roomx != game.saverx || game.roomy != game.savery)
{
gotoroom(game.saverx, game.savery);
if (player_died)
{
twoframedelayfix();
}
}
int i = obj.getplayer();
if(INBOUNDS_VEC(i, obj.entities))