Moved E_InitStaticHandlers(true) a bit higher in the initialization so that local scripts receive PlayerEntered properly

This commit is contained in:
ZZYZX 2017-02-03 09:04:01 +02:00
commit 27c5e21a1d
3 changed files with 11 additions and 2 deletions

View file

@ -78,6 +78,7 @@
#ifndef NO_EDATA
#include "edata.h"
#endif
#include "events.h"
#include "fragglescript/t_fs.h"
@ -3627,6 +3628,10 @@ void P_SetupLevel (const char *lumpname, int position)
I_Error("Unable to open map '%s'\n", lumpname);
}
// [ZZ] init per-map static handlers. we need to call this before everything is set up because otherwise scripts don't receive PlayerEntered event
// (which happens at god-knows-what stage in this function, but definitely not the last part, because otherwise it'd work to put E_InitStaticHandlers before the player spawning)
E_InitStaticHandlers(true);
// generate a checksum for the level, to be included and checked with savegames.
map->GetChecksum(level.md5);
// find map num