From eb7d3c542ed656c209ecfa62d309198138764df8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 11 Oct 2023 00:35:16 +0200 Subject: [PATCH] eliminated all remaining uses of kDudeBase and kDudeMax outside of 'modern' code. --- source/games/blood/src/actor.cpp | 2 -- source/games/blood/src/ai.cpp | 2 +- source/games/blood/src/aiunicult.cpp | 3 +-- source/games/blood/src/callback.cpp | 1 - source/games/blood/src/common_game.h | 3 --- 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 600da89bd..837a10546 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2079,7 +2079,6 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) { int nDamage = (10 + Random(10)) << 4; actDamageSprite(missileOwner, actorHit, kDamageSpirit, nDamage); - int nType = missileOwner->GetType() - kDudeBase; if (missileOwner->xspr.health > 0) actHealDude(missileOwner, 10, missileOwner->startHealth()); } @@ -4128,7 +4127,6 @@ DBloodActor* actSpawnDude(DBloodActor* source, int nType, double dist) auto spawned = actSpawnSprite(source, kStatDude, cls, nType); if (!spawned) return nullptr; DAngle angle = source->spr.Angles.Yaw; - int nDude = nType - kDudeBase; auto pos = source->spr.pos; diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index 1fe912c06..d2fd35365 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -934,7 +934,7 @@ void aiSetTarget(DBloodActor* actor, DBloodActor* target) actor->SetTarget(nullptr); return; } - if (target->GetType() >= kDudeBase && target->GetType() < kDudeMax) + if (target->IsDudeActor()) { if (actor->GetOwner() != target) { diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index 8e3026bfc..01662c2ee 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -296,7 +296,7 @@ static void ThrowThing(DBloodActor* actor, bool impact) if (target == nullptr) return; - if (!(target->GetType() >= kDudeBase && target->GetType() < kDudeMax)) + if (!(target->IsDudeActor()) return; int curWeapon = actor->genDudeExtra.curWeapon; @@ -1758,7 +1758,6 @@ void dudeLeechOperate(DBloodActor* actor, const EVENT& event) } double top, bottom; GetActorExtents(actor, &top, &bottom); - int nType = actTarget->GetType() - kDudeBase; double z1 = (top - actor->spr.pos.Z) - 1; auto atpos = actTarget->spr.pos; diff --git a/source/games/blood/src/callback.cpp b/source/games/blood/src/callback.cpp index 3c7a31791..1d9a1691f 100644 --- a/source/games/blood/src/callback.cpp +++ b/source/games/blood/src/callback.cpp @@ -282,7 +282,6 @@ void Respawn(DBloodActor* actor) // 9 actor->xspr.isTriggered = 0; if (actor->IsDudeActor()) { - int nType = actor->GetType() - kDudeBase; actor->spr.pos = actor->basePoint; actor->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL; #ifdef NOONE_EXTENSIONS diff --git a/source/games/blood/src/common_game.h b/source/games/blood/src/common_game.h index f01cb0614..b5f98837c 100644 --- a/source/games/blood/src/common_game.h +++ b/source/games/blood/src/common_game.h @@ -251,7 +251,6 @@ enum { kItemMax = 151, // dudes - kDudeBase = 200, kDudeCultistTommy = 201, kDudeCultistShotgun = 202, kDudeZombieAxeNormal = 203, @@ -305,8 +304,6 @@ enum { kDudeBeast = 251, kDudeBurningTinyCaleb = 252, kDudeBurningBeast = 253, - kDudeVanillaMax = 254, - kDudeMax = 256, kMissileBase = 300, kMissileButcherKnife = kMissileBase,