From 952219a0184abf8c9f4776acc0873a5bc1ae07d4 Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Wed, 11 May 2016 06:59:11 -0500 Subject: [PATCH] Added RTF_THRUSTZ for A_RadiusThrust. - Allows thrusting with Z velocity. --- src/p_local.h | 1 + src/p_map.cpp | 2 +- src/thingdef/thingdef_codeptr.cpp | 8 +++++--- wadsrc/static/actors/constants.txt | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index 48014f993e..8e64c34148 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -343,6 +343,7 @@ enum RADF_NOIMPACTDAMAGE = 2, RADF_SOURCEISSPOT = 4, RADF_NODAMAGE = 8, + RADF_THRUSTZ = 16, }; void P_RadiusAttack (AActor *spot, AActor *source, int damage, int distance, FName damageType, int flags, int fulldamagedistance=0); diff --git a/src/p_map.cpp b/src/p_map.cpp index 88366baac1..22004b8979 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -5321,7 +5321,7 @@ void P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bo vz *= 0.8; } thing->Thrust(bombspot->AngleTo(thing), thrust); - if (!(flags & RADF_NODAMAGE)) + if (!(flags & RADF_NODAMAGE) || (flags & RADF_THRUSTZ)) thing->Vel.Z += vz; // this really doesn't work well } } diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index e5d0800954..b2373a7a0b 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1143,9 +1143,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Explode) enum { - RTF_AFFECTSOURCE = 1, - RTF_NOIMPACTDAMAGE = 2, - RTF_NOTMISSILE = 4, + RTF_AFFECTSOURCE = 1, + RTF_NOIMPACTDAMAGE = 2, + RTF_NOTMISSILE = 4, + RTF_THRUSTZ = 8, }; DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusThrust) @@ -1167,6 +1168,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusThrust) sourcenothrust = true; self->target->flags2 &= ~MF2_NODMGTHRUST; } + if (flags & RTF_THRUSTZ) flags |= RADF_THRUSTZ; P_RadiusAttack (self, self->target, force, distance, self->DamageType, flags | RADF_NODAMAGE, fullthrustdistance); P_CheckSplash(self, distance); diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 9ccb1fd6ee..7b8e25a9fe 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -178,6 +178,7 @@ const int XF_NOTMISSILE = 4; const int RTF_AFFECTSOURCE = 1; const int RTF_NOIMPACTDAMAGE = 2; const int RTF_NOTMISSILE = 4; +const int RTF_THRUSTZ = 8; // Flags for A_Blast const int BF_USEAMMO = 1;