Added CheckReplacee.

- Allows defining of what actor is replacing another for information.
- If multiple arachnotrons, a modder can attribute them as being a replacer of Arachnotron itself, allowing A_BossDeath and GetReplacee to work with it.
This commit is contained in:
Major Cooke 2019-01-27 18:03:04 -06:00 committed by Christoph Oelckers
commit b1c508fa6c
4 changed files with 56 additions and 1 deletions

View file

@ -593,6 +593,16 @@ PClassActor *PClassActor::GetReplacee(bool lookskill)
}
}
PClassActor *savedrep = ActorInfo()->Replacee;
// [MC] Same code as CheckReplacement but turned around so modders can indicate
// what monsters spawn from which entity. I.e. instead of a randomspawner
// 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 (E_CheckReplacee(&savedrep, this))
{
// [MK] the replacement is final, so don't continue with the chain
return savedrep ? savedrep : this;
}
if (savedrep == nullptr && (!lookskill || skillrepname == NAME_None))
{
return this;