- genDudeUpdate handled.

This commit is contained in:
Christoph Oelckers 2021-08-31 22:01:28 +02:00
parent 49f75e6f51
commit 05571de93a
3 changed files with 14 additions and 12 deletions

View file

@ -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();

View file

@ -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

View file

@ -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) {