From 2738d8e2a4cc3c3aa270e6359c97bc10cfe0f8fa Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 1 Sep 2018 19:36:15 +0000 Subject: [PATCH] Add PROJECTILE_RPG_IMPACT_DAMAGE flag for projectiles, 0x00400000. This makes PROJECTILE_RPG_IMPACT function more or less how it did prior to late 2016 when an issue involving the damage was identified and fixed, and moves the damage to the new flag. git-svn-id: https://svn.eduke32.com/eduke32@6974 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/actors.cpp | 4 +++- source/duke3d/src/actors.h | 1 + source/duke3d/src/player.cpp | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/duke3d/src/actors.cpp b/source/duke3d/src/actors.cpp index 757d3f45c..35148d543 100644 --- a/source/duke3d/src/actors.cpp +++ b/source/duke3d/src/actors.cpp @@ -2945,7 +2945,9 @@ ACTOR_STATIC void Proj_MoveCustom(int const spriteNum) { actor[otherSprite].owner = pSprite->owner; actor[otherSprite].picnum = pSprite->picnum; - actor[otherSprite].extra += pProj->extra; + + if (pProj->workslike & PROJECTILE_RPG_IMPACT_DAMAGE) + actor[otherSprite].extra += pProj->extra; A_DoProjectileEffects(spriteNum, &davect, 0); diff --git a/source/duke3d/src/actors.h b/source/duke3d/src/actors.h index 05980ac58..c41b2f6b5 100644 --- a/source/duke3d/src/actors.h +++ b/source/duke3d/src/actors.h @@ -284,6 +284,7 @@ enum pflags_t PROJECTILE_REALCLIPDIST = 0x00080000, PROJECTILE_ACCURATE = 0x00100000, PROJECTILE_NOSETOWNERSHADE = 0x00200000, + PROJECTILE_RPG_IMPACT_DAMAGE = 0x00400000, PROJECTILE_MOVED = 0x80000000, // internal flag, do not document PROJECTILE_TYPE_MASK = PROJECTILE_HITSCAN | PROJECTILE_RPG | PROJECTILE_KNEE | PROJECTILE_BLOOD, }; diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index 7174c74f2..92f472c58 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -971,8 +971,7 @@ static int A_ShootCustom(int const spriteNum, int const projecTile, int shootAng startPos->y + tabledivide32_noinline(sintable[(shootAng + 348) & 2047], pProj->offset), startPos->z - (1 << 8), projecTile, 0, 14, 14, shootAng, pProj->vel, zvel, spriteNum, 4); - - if (pProj->workslike & PROJECTILE_RPG_IMPACT) + if (pProj->workslike & PROJECTILE_RPG_IMPACT_DAMAGE) sprite[otherSprite].extra = Proj_GetDamage(pProj); if (!(pProj->workslike & PROJECTILE_BOUNCESOFFWALLS))