mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
ACS_RunPlayerEnterScript: If betweenmaps, defer until P_PostLoadLevel
Guarantees that the ENTER script actually consistently runs, since previously it was happening before ACS scope invalidation
This commit is contained in:
parent
193c85a418
commit
e9205e19d6
2 changed files with 12 additions and 11 deletions
13
src/g_game.c
13
src/g_game.c
|
|
@ -2519,9 +2519,9 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
}
|
||||
}
|
||||
|
||||
if (p->spectator == false)
|
||||
if (p->spectator == false && !betweenmaps)
|
||||
{
|
||||
if (betweenmaps || enteredGame == true)
|
||||
if (enteredGame == true)
|
||||
{
|
||||
ACS_RunPlayerEnterScript(p);
|
||||
}
|
||||
|
|
@ -2530,15 +2530,6 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
ACS_RunPlayerRespawnScript(p);
|
||||
}
|
||||
}
|
||||
|
||||
if (betweenmaps)
|
||||
return;
|
||||
|
||||
if (leveltime < starttime)
|
||||
return;
|
||||
|
||||
if (exiting)
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -8892,6 +8892,16 @@ void P_PostLoadLevel(void)
|
|||
ACS_RunLevelStartScripts();
|
||||
LUA_HookInt(gamemap, HOOK(MapLoad));
|
||||
|
||||
UINT8 i;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
if (players[i].spectator)
|
||||
continue;
|
||||
ACS_RunPlayerEnterScript(&players[i]);
|
||||
}
|
||||
|
||||
P_MapEnd();
|
||||
|
||||
// We're now done loading the level.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue