From 9801ce25ddea02f8565283bbe50ea4c562b3cd02 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 6 May 2021 09:02:49 +0200 Subject: [PATCH] - scaleDamage --- source/games/blood/src/aiunicult.cpp | 13 +++++++------ source/games/blood/src/aiunicult.h | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index 57a1f9716..581d2aa52 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -1531,11 +1531,12 @@ bool dudeIsMelee(DBloodActor* actor) // //--------------------------------------------------------------------------- -void scaleDamage(XSPRITE* pXSprite) { - - short curWeapon = gGenDudeExtra[sprite[pXSprite->reference].index].curWeapon; - short weaponType = gGenDudeExtra[sprite[pXSprite->reference].index].weaponType; - signed short* curScale = gGenDudeExtra[sprite[pXSprite->reference].index].dmgControl; +static void scaleDamage(DBloodActor* actor) +{ + auto const pXSprite = &actor->x(); + short curWeapon = actor->genDudeExtra().curWeapon; + short weaponType = actor->genDudeExtra().weaponType; + signed short* curScale = actor->genDudeExtra().dmgControl; for (int i = 0; i < kDmgMax; i++) curScale[i] = getDudeInfo(kDudeModernCustom)->startDamage[i]; @@ -2315,7 +2316,7 @@ bool genDudePrepare(spritetype* pSprite, int propId) { } case kGenDudePropertyDmgScale: - scaleDamage(pXSprite); + scaleDamage(actor); if (propId) break; [[fallthrough]]; diff --git a/source/games/blood/src/aiunicult.h b/source/games/blood/src/aiunicult.h index 4c8d0912c..cd550c061 100644 --- a/source/games/blood/src/aiunicult.h +++ b/source/games/blood/src/aiunicult.h @@ -228,7 +228,6 @@ short inDuck(AISTATE* aiState); int genDudeSeqStartId(XSPRITE* pXSprite); int getRangeAttackDist(spritetype* pSprite, int minDist = 3000, int maxDist = 80000); int getDispersionModifier(spritetype* pSprite, int minDisp, int maxDisp); -void scaleDamage(XSPRITE* pXSprite); bool genDudePrepare(spritetype* pSprite, int propId); void genDudeUpdate(DBloodActor* pSprite); void genDudePostDeath(spritetype* pSprite, DAMAGE_TYPE damageType, int damage);