- killDudeLeech

This commit is contained in:
Christoph Oelckers 2021-05-05 21:22:09 +02:00
parent 040049f83e
commit d892efb78a
2 changed files with 17 additions and 8 deletions

View file

@ -1438,7 +1438,7 @@ void removeDudeStuff(DBloodActor* actor)
actPostSprite(actor2, kStatFree);
break;
case kModernThingEnemyLifeLeech:
killDudeLeech(pSprite2);
killDudeLeech(actor2);
break;
}
}
@ -1487,16 +1487,25 @@ void removeLeech(DBloodActor* actLeech, bool delSprite)
}
}
void killDudeLeech(spritetype* pLeech) {
if (pLeech != NULL) {
actDamageSprite(&bloodActors[pLeech->owner], &bloodActors[pLeech->index], kDamageExplode, 65535);
sfxPlay3DSoundCP(pLeech, 522, -1, 0, 60000);
if (pLeech->owner >= 0 && pLeech->owner < kMaxSprites)
gGenDudeExtra[sprite[pLeech->owner].index].pLifeLeech = nullptr;
void killDudeLeech(DBloodActor* actLeech)
{
if (actLeech != NULL)
{
actDamageSprite(actLeech->GetOwner(), actLeech, kDamageExplode, 65535);
sfxPlay3DSoundCP(actLeech, 522, -1, 0, 60000);
if (actLeech->GetOwner() != nullptr)
actLeech->GetOwner()->genDudeExtra().pLifeLeech = nullptr;
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
XSPRITE* getNextIncarnation(XSPRITE* pXSprite) {
for (int i = bucketHead[pXSprite->txID]; i < bucketHead[pXSprite->txID + 1]; i++) {
if (rxBucket[i].type != 3 || rxBucket[i].index == pXSprite->reference)

View file

@ -196,7 +196,7 @@ struct GENDUDEEXTRA
extern GENDUDEEXTRA gGenDudeExtra[kMaxSprites];
XSPRITE* getNextIncarnation(XSPRITE* pXSprite);
void killDudeLeech(spritetype* pLeech);
void killDudeLeech(DBloodActor* pLeech);
void removeLeech(DBloodActor* pLeech, bool delSprite = true);
void removeDudeStuff(DBloodActor* pSprite);
DBloodActor* leechIsDropped(DBloodActor* pSprite);