Hotfix: The output from CheckReplacement no longer permanently overrides an actor's replacement.

This commit is contained in:
Marisa Kirisame 2018-09-23 23:34:20 +02:00 committed by Christoph Oelckers
parent 3b8b312fae
commit a9b25242cd

View file

@ -438,6 +438,7 @@ PClassActor *PClassActor::GetReplacement(bool lookskill)
}
// The Replacement field is temporarily NULLed to prevent
// potential infinite recursion.
PClassActor *oldrep = ActorInfo()->Replacement;
ActorInfo()->Replacement = nullptr;
PClassActor *rep = Replacement;
// Handle skill-based replacement here. It has precedence on DECORATE replacement
@ -451,7 +452,7 @@ PClassActor *PClassActor::GetReplacement(bool lookskill)
// Skill replacements are not recursive, contrarily to DECORATE replacements
rep = rep->GetReplacement(false);
// Reset the temporarily NULLed field
ActorInfo()->Replacement = Replacement;
ActorInfo()->Replacement = oldrep;
return rep;
}