- 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

@ -347,7 +347,7 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags, FName MeansOf
}
// [ZZ] Fire WorldThingDied script hook.
eventManager.WorldThingDied(this, inflictor);
Level->localEventManager->WorldThingDied(this, inflictor);
// [JM] Fire KILL type scripts for actor. Not needed for players, since they have the "DEATH" script type.
if (!player && !(flags7 & MF7_NOKILLSCRIPTS) && ((flags7 & MF7_USEKILLSCRIPTS) || gameinfo.forcekillscripts))
@ -560,7 +560,7 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags, FName MeansOf
ClientObituary (this, inflictor, source, dmgflags, MeansOfDeath);
// [ZZ] fire player death hook
eventManager.PlayerDied(Level->PlayerNum(player));
Level->localEventManager->PlayerDied(Level->PlayerNum(player));
// Death script execution, care of Skull Tag
Level->Behaviors.StartTypedScripts (SCRIPT_Death, this, true);
@ -1460,7 +1460,7 @@ static int DamageMobj (AActor *target, AActor *inflictor, AActor *source, int da
}
const int realdamage = MAX(0, damage);
eventManager.WorldThingDamaged(target, inflictor, source, realdamage, mod, flags, angle);
target->Level->localEventManager->WorldThingDamaged(target, inflictor, source, realdamage, mod, flags, angle);
needevent = false;
target->CallDie (source, inflictor, flags, MeansOfDeath);
@ -1481,7 +1481,7 @@ static int DoDamageMobj(AActor *target, AActor *inflictor, AActor *source, int d
if (realdamage > 0 && needevent)
{
// [ZZ] event handlers only need the resultant damage (they can't do anything about it anyway)
eventManager.WorldThingDamaged(target, inflictor, source, realdamage, mod, flags, angle);
target->Level->localEventManager->WorldThingDamaged(target, inflictor, source, realdamage, mod, flags, angle);
}
return MAX(0, realdamage);