- separation of static and map-local event handlers into separate lists.

Having everything lumped together made this a maintenance hassle because it affected how the level has to be stored.
This hasn't been tested yet, so it may not work as intended!
This commit is contained in:
Christoph Oelckers 2019-02-02 16:43:11 +01:00
commit 66eb4e5048
29 changed files with 240 additions and 242 deletions

View file

@ -395,7 +395,7 @@ void PClassActor::StaticInit()
InitBotStuff();
// reinit GLOBAL static stuff from gameinfo, once classes are loaded.
eventManager.InitStaticHandlers(false);
staticEventManager.InitStaticHandlers(false);
}
//==========================================================================
@ -517,7 +517,7 @@ void PClassActor::RegisterIDs()
//
//==========================================================================
PClassActor *PClassActor::GetReplacement(bool lookskill)
PClassActor *PClassActor::GetReplacement(FLevelLocals *Level, bool lookskill)
{
FName skillrepname = NAME_None;
@ -538,7 +538,7 @@ PClassActor *PClassActor::GetReplacement(bool lookskill)
}
// [MK] ZScript replacement through Event Handlers, has priority over others
PClassActor *Replacement = ActorInfo()->Replacement;
if (eventManager.CheckReplacement(this,&Replacement) )
if (Level->localEventManager->CheckReplacement(this,&Replacement) )
{
// [MK] the replacement is final, so don't continue with the chain
return Replacement ? Replacement : this;
@ -573,7 +573,7 @@ PClassActor *PClassActor::GetReplacement(bool lookskill)
//
//==========================================================================
PClassActor *PClassActor::GetReplacee(bool lookskill)
PClassActor *PClassActor::GetReplacee(FLevelLocals *Level, bool lookskill)
{
FName skillrepname = NAME_None;
@ -598,7 +598,7 @@ PClassActor *PClassActor::GetReplacee(bool lookskill)
// showing up, one can assign an Arachnotron as the one being replaced
// so functions like CheckReplacee and A_BossDeath can actually work, given
// modders set it up that way.
if (eventManager.CheckReplacee(&savedrep, this))
if (Level->localEventManager->CheckReplacee(&savedrep, this))
{
// [MK] the replacement is final, so don't continue with the chain
return savedrep ? savedrep : this;