diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index e57f58fb2..c1ff7853d 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -68,6 +68,7 @@ #include "g_shared/a_specialspot.h" #include "actorptrselect.h" #include "m_bbox.h" +#include "r_data/r_translate.h" static FRandom pr_camissile ("CustomActorfire"); @@ -1729,6 +1730,7 @@ enum SIX_Flags SIXF_TRANSFERAMBUSHFLAG=256, SIXF_TRANSFERPITCH=512, SIXF_TRANSFERPOINTERS=1024, + SIXF_USEBLOODCOLOR=2048, }; @@ -1738,9 +1740,18 @@ static bool InitSpawnedItem(AActor *self, AActor *mo, int flags) { AActor * originator = self; - if ((flags & SIXF_TRANSFERTRANSLATION) && !(mo->flags2 & MF2_DONTTRANSLATE)) + if (!(mo->flags2 & MF2_DONTTRANSLATE)) { - mo->Translation = self->Translation; + if (flags & SIXF_TRANSFERTRANSLATION) + { + mo->Translation = self->Translation; + } + else if (flags & SIXF_USEBLOODCOLOR) + { + // [XA] Use the spawning actor's BloodColor to translate the newly-spawned object. + PalEntry bloodcolor = self->GetBloodColor(); + mo->Translation = TRANSLATION(TRANSLATION_Blood, bloodcolor.a); + } } if (flags & SIXF_TRANSFERPOINTERS) { diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index c7e831a88..07dbeda7d 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -53,6 +53,7 @@ const int SXF_CLIENTSIDE=128; // only used by Skulltag const int SXF_TRANSFERAMBUSHFLAG=256; const int SXF_TRANSFERPITCH=512; const int SXF_TRANSFERPOINTERS=1024; +const int SXF_USEBLOODCOLOR=2048; // Flags for A_Chase const int CHF_FASTCHASE = 1;