Add "IsFinal" parameter for CheckReplacement.
If set to true it guarantees that the replacement is final and will not go through the rest of the replacement chain.
This commit is contained in:
parent
4e690b1f60
commit
02926a5567
4 changed files with 17 additions and 7 deletions
|
|
@ -427,7 +427,11 @@ PClassActor *PClassActor::GetReplacement(bool lookskill)
|
|||
}
|
||||
// [MK] ZScript replacement through Event Handlers, has priority over others
|
||||
PClassActor *Replacement = ActorInfo()->Replacement;
|
||||
E_CheckReplacement(this,&Replacement);
|
||||
if ( E_CheckReplacement(this,&Replacement) )
|
||||
{
|
||||
// [MK] the replacement is final, so don't continue with the chain
|
||||
return Replacement ? Replacement : this;
|
||||
}
|
||||
if (Replacement == nullptr && (!lookskill || skillrepname == NAME_None))
|
||||
{
|
||||
return this;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue