Skip to content

Commit

Permalink
- killDudeLeech
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Oct 12, 2021
1 parent 040049f commit d892efb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
23 changes: 16 additions & 7 deletions source/games/blood/src/aiunicult.cpp
Expand Up @@ -1438,7 +1438,7 @@ void removeDudeStuff(DBloodActor* actor)
actPostSprite(actor2, kStatFree);
break;
case kModernThingEnemyLifeLeech:
killDudeLeech(pSprite2);
killDudeLeech(actor2);
break;
}
}
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion source/games/blood/src/aiunicult.h
Expand Up @@ -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);
Expand Down

0 comments on commit d892efb

Please sign in to comment.