- handled all pSprite-> in actor.cpp.

This commit is contained in:
Christoph Oelckers 2021-12-22 16:43:59 +01:00
parent 27e9894ece
commit b91fe45fc3
4 changed files with 343 additions and 408 deletions

File diff suppressed because it is too large Load diff

View file

@ -2590,7 +2590,7 @@ void genDudePostDeath(DBloodActor* actor, DAMAGE_TYPE damageType, int damage)
fxSpawnBlood(actor, damage); fxSpawnBlood(actor, damage);
} }
gKillMgr.AddKill(pSprite); gKillMgr.AddKill(actor);
pSprite->type = kThingBloodChunks; pSprite->type = kThingBloodChunks;
actPostSprite(actor, kStatThing); actPostSprite(actor, kStatThing);

View file

@ -78,9 +78,9 @@ void CKillMgr::AddNewKill(int nCount)
TotalKills += nCount; TotalKills += nCount;
} }
void CKillMgr::AddKill(spritetype* pSprite) void CKillMgr::AddKill(DBloodActor* actor)
{ {
if (pSprite->statnum == kStatDude && pSprite->type != kDudeBat && pSprite->type != kDudeRat && pSprite->type != kDudeInnocent && pSprite->type != kDudeBurningInnocent) if (actor->spr.statnum == kStatDude && actor->spr.type != kDudeBat && actor->spr.type != kDudeRat && actor->spr.type != kDudeInnocent && actor->spr.type != kDudeBurningInnocent)
Kills++; Kills++;
} }
@ -90,10 +90,9 @@ void CKillMgr::CountTotalKills(void)
BloodStatIterator it(kStatDude); BloodStatIterator it(kStatDude);
while (auto actor = it.Next()) while (auto actor = it.Next())
{ {
spritetype* pSprite = &actor->s(); if (actor->spr.type < kDudeBase || actor->spr.type >= kDudeMax)
if (pSprite->type < kDudeBase || pSprite->type >= kDudeMax)
I_Error("Non-enemy sprite (%d) in the enemy sprite list.", actor->GetIndex()); I_Error("Non-enemy sprite (%d) in the enemy sprite list.", actor->GetIndex());
if (pSprite->statnum == kStatDude && pSprite->type != kDudeBat && pSprite->type != kDudeRat && pSprite->type != kDudeInnocent && pSprite->type != kDudeBurningInnocent) if (actor->spr.statnum == kStatDude && actor->spr.type != kDudeBat && actor->spr.type != kDudeRat && actor->spr.type != kDudeInnocent && actor->spr.type != kDudeBurningInnocent)
TotalKills++; TotalKills++;
} }
} }

View file

@ -31,7 +31,7 @@ public:
int TotalKills, Kills; int TotalKills, Kills;
void SetCount(int); void SetCount(int);
void AddNewKill(int); void AddNewKill(int);
void AddKill(spritetype *pSprite); void AddKill(DBloodActor *actor);
void CountTotalKills(void); void CountTotalKills(void);
void Clear(void); void Clear(void);
}; };