From 0b95b47f87a7e6d17049e9c2fd6e5343897d5766 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 3 Feb 2009 05:46:55 +0000 Subject: [PATCH] - Changed DECORATE replacements so that they aren't overridden by Dehacked. SVN r1391 (trunk) --- docs/rh-log.txt | 3 +++ src/d_dehacked.cpp | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index f8fd017ecf..c44ec99f5b 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,6 @@ +February 2, 2009 +- Changed DECORATE replacements so that they aren't overridden by Dehacked. + February 2, 2009 (Changes by Graf Zahl) - Fixed: The damage factor for 'normal' damage is supposed to be applied to all damage types that don't have a specific damage factor. diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index 6977179d39..4194055a3f 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -2585,7 +2585,7 @@ void FinishDehPatch () AActor *defaults2 = GetDefaultByType (subclass); memcpy (defaults2, defaults1, sizeof(AActor)); - // Make a copy the replaced class's state labels + // Make a copy of the replaced class's state labels FStateDefinitions statedef; statedef.MakeStateDefines(type); @@ -2598,8 +2598,16 @@ void FinishDehPatch () // Use the DECORATE replacement feature to redirect all spawns // of the original class to the new one. + FActorInfo *old_replacement = type->ActorInfo->Replacement; + type->ActorInfo->Replacement = subclass->ActorInfo; subclass->ActorInfo->Replacee = type->ActorInfo; + // If this actor was already replaced by another actor, copy that + // replacement over to this item. + if (old_replacement != NULL) + { + subclass->ActorInfo->Replacement = old_replacement; + } DPrintf ("%s replaces %s\n", subclass->TypeName.GetChars(), type->TypeName.GetChars()); }