Allow WorldUnloaded events to know the next map name (if any).

This commit is contained in:
Mari the Deer 2021-09-27 19:40:57 +02:00 committed by Christoph Oelckers
commit 457f7c31c3
4 changed files with 13 additions and 8 deletions

View file

@ -468,7 +468,7 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
// did we have any level before?
if (primaryLevel->info != nullptr)
staticEventManager.WorldUnloaded();
staticEventManager.WorldUnloaded(FString()); // [MK] don't pass the new map, as it's not a level transition
if (!savegamerestore)
{
@ -701,10 +701,10 @@ void FLevelLocals::ChangeLevel(const char *levelname, int position, int inflags,
for (auto Level : AllLevels())
{
// Todo: This must be exolicitly sandboxed!
Level->localEventManager->WorldUnloaded();
Level->localEventManager->WorldUnloaded(nextlevel);
}
// [ZZ] unsafe world unload (changemap != map)
staticEventManager.WorldUnloaded();
staticEventManager.WorldUnloaded(nextlevel);
unloading = false;
STAT_ChangeLevel(nextlevel, this);