From aa3d0b8be744d196f8cb45402014903d9dbfc428 Mon Sep 17 00:00:00 2001 From: gez Date: Thu, 14 Mar 2013 07:42:44 +0000 Subject: [PATCH] * Updated to ZDoom 4181: - Fixed: P_SpawnPlayerMissile() should not 0 the pitch for weapons that don't autoaim. This allows A_FireOldBFG to work properly when freelook is disabled. - Fixed: The sc_man scanner must use an unsigned character type, or it won't properly recognize any unquoted characters with the eighth bit set. - Added A_SetDamageType. - Added Xaser's SXF_USEBLOODCOLOR for A_SpawnItemEx submission. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1537 b0f79afe-0144-0410-b225-9a4edf0717df --- src/p_mobj.cpp | 16 ++++++++------- src/sc_man_scanner.h | 2 +- src/sc_man_scanner.re | 2 +- src/svnrevision.h | 4 ++-- src/thingdef/thingdef_codeptr.cpp | 31 +++++++++++++++++++++++++++--- wadsrc/static/actors/actor.txt | 1 + wadsrc/static/actors/constants.txt | 1 + 7 files changed, 43 insertions(+), 14 deletions(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 075d130c..f07ab0ff 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -5628,7 +5628,9 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z, if (source && source->player && source->player->ReadyWeapon && (source->player->ReadyWeapon->WeaponFlags & WIF_NOAUTOAIM)) { // Keep exactly the same angle and pitch as the player's own aim - pitch = source->pitch; linetarget = NULL; + an = angle; + pitch = source->pitch; + linetarget = NULL; } else // see which target is to be aimed at { @@ -5646,14 +5648,14 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z, break; } } while (linetarget == NULL && --i >= 0); - } - if (linetarget == NULL) - { - an = angle; - if (nofreeaim || !level.IsFreelookAllowed()) + if (linetarget == NULL) { - pitch = 0; + an = angle; + if (nofreeaim || !level.IsFreelookAllowed()) + { + pitch = 0; + } } } if (pLineTarget) *pLineTarget = linetarget; diff --git a/src/sc_man_scanner.h b/src/sc_man_scanner.h index bc5904ab..6a355809 100644 --- a/src/sc_man_scanner.h +++ b/src/sc_man_scanner.h @@ -1,6 +1,6 @@ /* Generated by re2c 0.12.3 */ #line 1 "src/sc_man_scanner.re" -#define YYCTYPE char +#define YYCTYPE unsigned char #define YYCURSOR cursor #define YYLIMIT limit #define YYMARKER marker diff --git a/src/sc_man_scanner.re b/src/sc_man_scanner.re index 66058ac8..dd90ce1d 100644 --- a/src/sc_man_scanner.re +++ b/src/sc_man_scanner.re @@ -1,4 +1,4 @@ -#define YYCTYPE char +#define YYCTYPE unsigned char #define YYCURSOR cursor #define YYLIMIT limit #define YYMARKER marker diff --git a/src/svnrevision.h b/src/svnrevision.h index da3bfba0..ad97c04a 100644 --- a/src/svnrevision.h +++ b/src/svnrevision.h @@ -3,5 +3,5 @@ // This file was automatically generated by the // updaterevision tool. Do not edit by hand. -#define ZD_SVN_REVISION_STRING "4177" -#define ZD_SVN_REVISION_NUMBER 4177 +#define ZD_SVN_REVISION_STRING "4181" +#define ZD_SVN_REVISION_NUMBER 4181 diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index c86c78a1..c1ff7853 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) { @@ -4509,4 +4520,18 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTics) ACTION_PARAM_INT(tics_to_set, 0); self->tics = tics_to_set; -} \ No newline at end of file +} + +//========================================================================== +// +// A_SetDamageType +// +//========================================================================== + +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetDamageType) +{ + ACTION_PARAM_START(1); + ACTION_PARAM_NAME(damagetype, 0); + + self->DamageType = damagetype; +} diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index f7ee2676..b4024878 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -295,6 +295,7 @@ ACTOR Actor native //: Thinker action native A_SetSpecial(int spec, int arg0 = 0, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0); action native A_Quake(int intensity, int duration, int damrad, int tremrad, sound sfx = "world/quake"); action native A_SetTics(int tics); + action native A_SetDamageType(name damagetype); action native A_CheckSightOrRange(float distance, state label); diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index c7e831a8..07dbeda7 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;