From 05571de93a78aec9ca3b757d96fa41410311e8a2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 31 Aug 2021 22:01:28 +0200 Subject: [PATCH] - genDudeUpdate handled. --- source/games/blood/src/aiunicult.cpp | 22 ++++++++++++---------- source/games/blood/src/aiunicult.h | 2 +- source/games/blood/src/nnexts.cpp | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index ab2dbace5..29ce7ac91 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -178,15 +178,17 @@ static bool genDudeAdjustSlope(DBloodActor* actor, int dist, int weaponType, int } -GENDUDEEXTRA* genDudeExtra(spritetype* pGenDude) { - return &gGenDudeExtra[pGenDude->index]; -} +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- -void genDudeUpdate(spritetype* pSprite) { - auto actor = &bloodActors[pSprite->index]; +void genDudeUpdate(DBloodActor* actor) +{ GENDUDEEXTRA* pExtra = &actor->genDudeExtra(); for (int i = 0; i < kGenDudePropertyMax; i++) { - if (pExtra->updReq[i]) genDudePrepare(pSprite, i); + if (pExtra->updReq[i]) genDudePrepare(&actor->s(), i); } } @@ -477,10 +479,10 @@ static void unicultThinkChase(DBloodActor* actor) if(spriteIsUnderwater(pSprite,false)) aiGenDudeNewState(actor, &genDudeGotoW); else aiGenDudeNewState(actor, &genDudeGotoL); return; - } else { - - genDudeUpdate(pSprite); - + } + else + { + genDudeUpdate(actor); } XSPRITE* pXTarget = !targetactor || !targetactor->IsDudeActor() || !targetactor->hasX() ? nullptr : &targetactor->x(); diff --git a/source/games/blood/src/aiunicult.h b/source/games/blood/src/aiunicult.h index f99f18292..9f1094bfa 100644 --- a/source/games/blood/src/aiunicult.h +++ b/source/games/blood/src/aiunicult.h @@ -230,7 +230,7 @@ int getRangeAttackDist(spritetype* pSprite, int minDist = 3000, int maxDist = 80 int getDispersionModifier(spritetype* pSprite, int minDisp, int maxDisp); void scaleDamage(XSPRITE* pXSprite); bool genDudePrepare(spritetype* pSprite, int propId); -void genDudeUpdate(spritetype* pSprite); +void genDudeUpdate(DBloodActor* pSprite); void genDudePostDeath(spritetype* pSprite, DAMAGE_TYPE damageType, int damage); void aiGenDudeInitSprite(spritetype* pSprite, XSPRITE* pXSprite); #endif diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index c12e04911..8db5364a8 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -7865,7 +7865,7 @@ void callbackMakeMissileBlocking(int nSprite) // 23 void callbackGenDudeUpdate(int nSprite) // 24 { if (spriRangeIsFine(nSprite)) - genDudeUpdate(&sprite[nSprite]); + genDudeUpdate(&bloodActors[nSprite]); } void clampSprite(spritetype* pSprite, int which) {