- Static NewGame events now fire before loading a map, and normal NewGame events fire after registering per-map handlers and before all other events.

- Static event handlers now unregister after per-map handlers.
- All event handlers now unregister in reverse order.
This commit is contained in:
player701 2018-10-31 10:15:56 +03:00 committed by Christoph Oelckers
commit 04ae32f6f9
7 changed files with 33 additions and 21 deletions

View file

@ -3642,7 +3642,7 @@ void P_FreeExtraLevelData()
//
//===========================================================================
void P_SetupLevel (const char *lumpname, int position)
void P_SetupLevel (const char *lumpname, int position, bool newGame)
{
cycle_t times[20];
#if 0
@ -3720,6 +3720,11 @@ void P_SetupLevel (const char *lumpname, int position)
level.lumpnum = map->lumpnum;
hasglnodes = false;
if (newGame)
{
E_NewGame(true);
}
// [RH] Support loading Build maps (because I felt like it. :-)
buildmap = false;
#if 0
@ -4298,13 +4303,13 @@ void P_Init ()
}
static void P_Shutdown ()
{
// [ZZ] delete global event handlers
DThinker::DestroyThinkersInList(STAT_STATIC);
E_Shutdown(false);
{
DThinker::DestroyThinkersInList(STAT_STATIC);
P_DeinitKeyMessages ();
P_FreeLevelData ();
P_FreeExtraLevelData ();
// [ZZ] delete global event handlers
E_Shutdown(false);
ST_Clear();
FS_Close();
for (auto &p : players)