From b0203c9f1d2ad985f853b6958cbdc068a1b6f80b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 13 Mar 2013 11:27:30 +0000 Subject: [PATCH] - added Xaser's SXF_USEBLOODCOLOR for A_SpawnItemEx submission SVN r4181 (trunk) --- src/thingdef/thingdef_codeptr.cpp | 15 +++++++++++++-- wadsrc/static/actors/constants.txt | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index e57f58fb24..c1ff7853de 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 c7e831a88a..07dbeda7dc 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;