Fix duplication of SWWMGlobals on map change.

This commit is contained in:
Mari the Deer 2023-07-01 14:10:36 +02:00
commit 3501b587d3
3 changed files with 5 additions and 4 deletions

View file

@ -150,8 +150,6 @@ Class SWWMHandler : EventHandler
while ( sv = si.Next() ) funtagsv.Push(sv);
si = ServiceIterator.Find("MergeMonsterService");
while ( sv = si.Next() ) mergemonstersv.Push(sv);
// session globals
gdat = SWWMGlobals.Get();
// start profiling
if ( swwm_profstart <= 0 ) return;
bprofiletics = profiletics = swwm_profstart;

View file

@ -260,6 +260,9 @@ extend Class SWWMHandler
override void WorldLoaded( WorldEvent e )
{
// session globals must be loaded here
// (if we do it in OnRegister the existing thinker might not have been deserialized yet)
gdat = SWWMGlobals.Get();
if ( e.IsReopen ) return;
MapStartDialogues();
if ( gamestate != GS_TITLELEVEL )