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 // The Replacement field is temporarily NULLed to prevent
// potential infinite recursion. // potential infinite recursion.
PClassActor *oldrep = ActorInfo()->Replacement;
ActorInfo()->Replacement = nullptr; ActorInfo()->Replacement = nullptr;
PClassActor *rep = Replacement; PClassActor *rep = Replacement;
// Handle skill-based replacement here. It has precedence on DECORATE 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 // Skill replacements are not recursive, contrarily to DECORATE replacements
rep = rep->GetReplacement(false); rep = rep->GetReplacement(false);
// Reset the temporarily NULLed field // Reset the temporarily NULLed field
ActorInfo()->Replacement = Replacement; ActorInfo()->Replacement = oldrep;
return rep; return rep;
} }