Fix two-frame script delay when respawning

At some point, there was some "kludge" added to the game which allowed
script boxes to immediately get triggered when you enter a room, rather
than the update order unfortunately causing scripts to trigger after two
frames.

For some reason, dying and respawning in a room does not have the same
fix, causing really bad inconsistencies for anything that needs precise
timing.

Despite the initial implementation of the kludge being somewhat careless
and breaking levels which relied on timing, this one should not break
anything, but in fact fix things, surprisingly.
This commit is contained in:
NyakoFox
2025-12-03 00:54:02 -04:00
committed by Ethan Lee
parent 0d69dd3820
commit c2a78ba688
+4 -1
View File
@@ -785,12 +785,15 @@ void mapclass::resetplayer(void)
void mapclass::resetplayer(const bool player_died)
{
bool was_in_tower = towermode;
game.deathseq = -1;
if (game.roomx != game.saverx || game.roomy != game.savery)
{
gotoroom(game.saverx, game.savery);
twoframedelayfix();
}
game.deathseq = -1;
int i = obj.getplayer();
if(INBOUNDS_VEC(i, obj.entities))
{