From b2582dcb8442761e9e19b15a44297036840cae29 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 30 Sep 2023 10:12:36 +0200 Subject: [PATCH] quick replacements of many spr.type uses --- source/games/blood/src/actor.cpp | 36 ++++++++++++------------ source/games/blood/src/ai.cpp | 42 ++++++++++++++-------------- source/games/blood/src/aibat.cpp | 20 ++++++------- source/games/blood/src/aibeast.cpp | 18 ++++++------ source/games/blood/src/aiboneel.cpp | 20 ++++++------- source/games/blood/src/aiburn.cpp | 4 +-- source/games/blood/src/aicaleb.cpp | 14 +++++----- source/games/blood/src/aicerber.cpp | 20 ++++++------- source/games/blood/src/aicult.cpp | 12 ++++---- source/games/blood/src/aigarg.cpp | 40 +++++++++++++------------- source/games/blood/src/aighost.cpp | 38 ++++++++++++------------- source/games/blood/src/aigilbst.cpp | 14 +++++----- source/games/blood/src/aihand.cpp | 4 +-- source/games/blood/src/aihound.cpp | 12 ++++---- source/games/blood/src/aiinnoc.cpp | 4 +-- source/games/blood/src/aipod.cpp | 8 +++--- source/games/blood/src/airat.cpp | 6 ++-- source/games/blood/src/aispid.cpp | 10 +++---- source/games/blood/src/aitchern.cpp | 12 ++++---- source/games/blood/src/aiunicult.cpp | 12 ++++---- source/games/blood/src/aizomba.cpp | 10 +++---- source/games/blood/src/aizombf.cpp | 4 +-- source/games/blood/src/bloodactor.h | 7 ++--- source/games/blood/src/callback.cpp | 6 ++-- source/games/blood/src/fx.cpp | 2 +- source/games/blood/src/loadsave.cpp | 2 +- source/games/blood/src/nnexts.cpp | 38 ++++++++++++------------- source/games/blood/src/player.cpp | 4 +-- source/games/blood/src/triggers.cpp | 2 +- 29 files changed, 210 insertions(+), 211 deletions(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 85a995bd1..b92c273ed 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2556,7 +2556,7 @@ static void ConcussSprite(DBloodActor* source, DBloodActor* actor, const DVector { mass = getDudeInfo(actor->spr.type)->mass; #ifdef NOONE_EXTENSIONS - if (actor->spr.type == kDudeModernCustom || actor->spr.type == kDudeModernCustomBurning) + if (actor->GetType() == kDudeModernCustom || actor->GetType() == kDudeModernCustomBurning) { mass = getSpriteMassBySize(actor); } @@ -3374,7 +3374,7 @@ static void genericDeath(DBloodActor* actor, int nSeq, int sound1, int seqnum) void actKillDude(DBloodActor* killerActor, DBloodActor* actor, DAMAGE_TYPE damageType, int damage) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax&& actor->hasX()); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax&& actor->hasX()); int nType = actor->spr.type - kDudeBase; if (actKillDudeStage1(actor, damageType)) return; @@ -3600,7 +3600,7 @@ static int actDamageDude(DBloodActor* source, DBloodActor* actor, int damage, DA int nType = actor->spr.type - kDudeBase; int nDamageFactor = getDudeInfo(nType + kDudeBase)->damageVal[damageType]; #ifdef NOONE_EXTENSIONS - if (actor->spr.type == kDudeModernCustom) + if (actor->GetType() == kDudeModernCustom) nDamageFactor = actor->genDudeExtra.dmgControl[damageType]; #endif @@ -3654,7 +3654,7 @@ static int actDamageThing(DBloodActor* source, DBloodActor* actor, int damage, D actor->xspr.stateTimer = actor->xspr.data4 = actor->xspr.isTriggered = 0; #ifdef NOONE_EXTENSIONS - if (Owner && Owner->spr.type == kDudeModernCustom) + if (Owner && Owner->GetType() == kDudeModernCustom) Owner->SetSpecialOwner(); // indicates if custom dude had life leech. #endif break; @@ -3905,7 +3905,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) case kMissileFireballNapalm: if (hitCode == 3 && actorHit && (pThingInfo || pDudeInfo)) { - if (pThingInfo && actorHit->spr.type == kThingTNTBarrel && actorHit->xspr.burnTime == 0) + if (pThingInfo && actorHit->GetType() == kThingTNTBarrel && actorHit->xspr.burnTime == 0) evPostActor(actorHit, 0, kCallbackFXFlameLick); int nDamage = (50 + Random(50)) << 4; @@ -3925,7 +3925,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) { if ((pThingInfo && pThingInfo->dmgControl[kDamageBurn] != 0) || (pDudeInfo && pDudeInfo->damageVal[kDamageBurn] != 0)) { - if (pThingInfo && actorHit->spr.type == kThingTNTBarrel && actorHit->xspr.burnTime == 0) + if (pThingInfo && actorHit->GetType() == kThingTNTBarrel && actorHit->xspr.burnTime == 0) evPostActor(actorHit, 0, kCallbackFXFlameLick); actBurnSprite(missileOwner, actorHit, 480); @@ -4556,7 +4556,7 @@ static Collision MoveThing(DBloodActor* actor) { actor->spr.pos.Z += FixedToFloat<8>(455); actor->vel.Z += FixedToFloat(58254); - if (actor->spr.type == kThingZombieHead) + if (actor->GetType() == kThingZombieHead) { auto* fxActor = gFX.fxSpawnActor(FX_27, actor->sector(), actor->spr.pos); if (fxActor) @@ -4693,9 +4693,9 @@ void MoveDude(DBloodActor* actor) { PLAYER* pPlayer = nullptr; if (actor->IsPlayerActor()) pPlayer = &gPlayer[actor->spr.type - kDudePlayer1]; - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "%d: actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax", actor->spr.type); + Printf(PRINT_HIGH, "%d: actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax", actor->spr.type); return; } @@ -5018,7 +5018,7 @@ void MoveDude(DBloodActor* actor) #ifdef NOONE_EXTENSIONS if (gModernMap) { - if (actor->spr.type == kDudeModernCustom) { + if (actor->GetType() == kDudeModernCustom) { evPostActor(actor, 0, kCallbackEnemeyBubble); if (!canSwim(actor)) actKillDude(actor, actor, kDamageFall, 1000 << 4); @@ -5520,7 +5520,7 @@ static void actCheckProximity() continue; #endif - if (actor->spr.type == kThingDroppedLifeLeech) actor->SetTarget(nullptr); + if (actor->GetType() == kThingDroppedLifeLeech) actor->SetTarget(nullptr); BloodStatIterator it1(kStatDude); while (auto dudeactor = it1.Next()) { @@ -5538,7 +5538,7 @@ static void actCheckProximity() if (actor->spr.type == kModernThingEnemyLifeLeech) proxyDist = 512; #endif - if (actor->spr.type == kThingDroppedLifeLeech && actor->GetTarget() == nullptr) + if (actor->GetType() == kThingDroppedLifeLeech && actor->GetTarget() == nullptr) { auto Owner = actor->GetOwner(); if (!Owner->IsPlayerActor()) continue; @@ -5546,7 +5546,7 @@ static void actCheckProximity() PLAYER* pPlayer = &gPlayer[Owner->spr.type - kDudePlayer1]; PLAYER* pPlayer2 = dudeactor->IsPlayerActor() ? &gPlayer[dudeactor->spr.type - kDudePlayer1] : nullptr; - if (dudeactor == Owner || dudeactor->spr.type == kDudeZombieAxeBuried || dudeactor->spr.type == kDudeRat || dudeactor->spr.type == kDudeBat) continue; + if (dudeactor == Owner || dudeactor->GetType() == kDudeZombieAxeBuried || dudeactor->GetType() == kDudeRat || dudeactor->GetType() == kDudeBat) continue; if (gGameOptions.nGameType == 3 && pPlayer2 && pPlayer->teamId == pPlayer2->teamId) continue; if (gGameOptions.nGameType == 1 && pPlayer2) continue; proxyDist = 512; @@ -5792,7 +5792,7 @@ static void actCheckExplosion() if (pExplodeInfo->burnTime) { - if (thingactor->spr.type == kThingTNTBarrel && !thingactor->xspr.burnTime) + if (thingactor->GetType() == kThingTNTBarrel && !thingactor->xspr.burnTime) evPostActor(thingactor, 0, kCallbackFXFlameLick); actBurnSprite(Owner, thingactor, pExplodeInfo->burnTime << 2); } @@ -5943,13 +5943,13 @@ static void actCheckDudes() #ifdef NOONE_EXTENSIONS // handle incarnations of custom dude - if (actor->spr.type == kDudeModernCustom && actor->xspr.txID > 0 && actor->xspr.sysData1 == kGenDudeTransformStatus) + if (actor->GetType() == kDudeModernCustom && actor->xspr.txID > 0 && actor->xspr.sysData1 == kGenDudeTransformStatus) { actor->vel.XY().Zero(); if (seqGetStatus(actor) < 0) genDudeTransform(actor); } #endif - if (actor->spr.type == kDudeCerberusTwoHead) + if (actor->GetType() == kDudeCerberusTwoHead) { if (actor->xspr.health <= 0 && seqGetStatus(actor) < 0) { @@ -6560,7 +6560,7 @@ bool actCheckRespawn(DBloodActor* actor) if (actor->spr.type >= kThingBase && actor->spr.type < kThingMax) { actor->xspr.respawnPending = 3; - if (actor->spr.type == kThingTNTBarrel) actor->spr.cstat |= CSTAT_SPRITE_INVISIBLE; + if (actor->GetType() == kThingTNTBarrel) actor->spr.cstat |= CSTAT_SPRITE_INVISIBLE; } if (nRespawnTime > 0) { @@ -6569,7 +6569,7 @@ bool actCheckRespawn(DBloodActor* actor) actPostSprite(actor, kStatRespawn); actor->spr.flags |= kHitagRespawn; - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; actor->spr.pos = actor->basePoint; diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index 289a5b5a1..68be52eab 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -45,7 +45,7 @@ const int gCultTeslaFireChance[5] = { 0x2000, 0x4000, 0x8000, 0xa000, 0xe000 }; bool dudeIsPlayingSeq(DBloodActor* actor, int nSeq) { - if (actor->spr.statnum == kStatDude && actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax) + if (actor->spr.statnum == kStatDude && actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax) { DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (seqGetID(actor) == pDudeInfo->seqStartID + nSeq && seqGetStatus(actor) >= 0) @@ -248,7 +248,7 @@ bool CanMove(DBloodActor* actor, DBloodActor* target, DAngle nAngle, double nRan void aiChooseDirection(DBloodActor* actor, DAngle direction) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DAngle vc = deltaangle(actor->spr.Angles.Yaw, direction); auto almost60deg = DAngle::fromBuild(341); // 60° does not work correctly - this is a little bit less, actually. DAngle v8 = vc.Sgn() == -1 ? -almost60deg : almost60deg; @@ -293,7 +293,7 @@ void aiChooseDirection(DBloodActor* actor, DAngle direction) void aiMoveForward(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -311,7 +311,7 @@ void aiMoveForward(DBloodActor* actor) void aiMoveTurn(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -326,7 +326,7 @@ void aiMoveTurn(DBloodActor* actor) void aiMoveDodge(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -350,7 +350,7 @@ void aiMoveDodge(DBloodActor* actor) void aiActivateDude(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); if (!actor->xspr.state) { aiChooseDirection(actor, (actor->xspr.TargetPos - actor->spr.pos).Angle()); @@ -388,7 +388,7 @@ void aiActivateDude(DBloodActor* actor) aiNewState(actor, &cultistSearch); if (Chance(0x8000)) { - if (actor->spr.type == kDudeCultistTommy) aiPlay3DSound(actor, 4008 + Random(5), AI_SFX_PRIORITY_1, -1); + if (actor->GetType() == kDudeCultistTommy) aiPlay3DSound(actor, 4008 + Random(5), AI_SFX_PRIORITY_1, -1); else aiPlay3DSound(actor, 1008 + Random(5), AI_SFX_PRIORITY_1, -1); } break; @@ -402,13 +402,13 @@ void aiActivateDude(DBloodActor* actor) { if (Chance(0x8000)) { - if (actor->spr.type == kDudeCultistTommy) aiPlay3DSound(actor, 4003 + Random(4), AI_SFX_PRIORITY_1, -1); + if (actor->GetType() == kDudeCultistTommy) aiPlay3DSound(actor, 4003 + Random(4), AI_SFX_PRIORITY_1, -1); else aiPlay3DSound(actor, 1003 + Random(4), AI_SFX_PRIORITY_1, -1); } switch (actor->xspr.medium) { case kMediumNormal: - if (actor->spr.type == kDudeCultistTommy) aiNewState(actor, &fanaticChase); + if (actor->GetType() == kDudeCultistTommy) aiNewState(actor, &fanaticChase); else aiNewState(actor, &cultistChase); break; case kMediumWater: @@ -694,7 +694,7 @@ void aiActivateDude(DBloodActor* actor) // play gargoyle statue breaking animation if data1 = 1. if (gModernMap && actor->xspr.data1 == 1) { - if (actor->spr.type == kDudeGargoyleStatueFlesh) aiNewState(actor, &statueFBreakSEQ); + if (actor->GetType() == kDudeGargoyleStatueFlesh) aiNewState(actor, &statueFBreakSEQ); else aiNewState(actor, &statueSBreakSEQ); } else @@ -702,14 +702,14 @@ void aiActivateDude(DBloodActor* actor) if (Chance(0x4000)) aiPlay3DSound(actor, 1401, AI_SFX_PRIORITY_1, -1); else aiPlay3DSound(actor, 1400, AI_SFX_PRIORITY_1, -1); - if (actor->spr.type == kDudeGargoyleStatueFlesh) aiNewState(actor, &gargoyleFMorph); + if (actor->GetType() == kDudeGargoyleStatueFlesh) aiNewState(actor, &gargoyleFMorph); else aiNewState(actor, &gargoyleSMorph); } #else if (Chance(0x4000)) aiPlay3DSound(actor, 1401, AI_SFX_PRIORITY_1, -1); else aiPlay3DSound(actor, 1400, AI_SFX_PRIORITY_1, -1); - if (actor->spr.type == kDudeGargoyleStatueFlesh) aiNewState(actor, &gargoyleFMorph); + if (actor->GetType() == kDudeGargoyleStatueFlesh) aiNewState(actor, &gargoyleFMorph); else aiNewState(actor, &gargoyleSMorph); #endif break; @@ -876,7 +876,7 @@ void aiActivateDude(DBloodActor* actor) aiNewState(actor, &podSearch); else { - if (actor->spr.type == kDudePodFire) + if (actor->GetType() == kDudePodFire) aiPlay3DSound(actor, 2453, AI_SFX_PRIORITY_1, -1); else aiPlay3DSound(actor, 2473, AI_SFX_PRIORITY_1, -1); @@ -915,7 +915,7 @@ void aiSetTarget(DBloodActor* actor, DBloodActor* target) actor->SetTarget(nullptr); return; } - if (target->spr.type >= kDudeBase && target->spr.type < kDudeMax) + if (target->GetType() >= kDudeBase && target->GetType() < kDudeMax) { if (actor->GetOwner() != target) { @@ -993,7 +993,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType return nDamage; } - if (actor->spr.type == kDudeModernCustomBurning) + if (actor->GetType() == kDudeModernCustomBurning) { if (Chance(0x2000) && actor->dudeExtra.time < PlayClock) { playGenDudeSound(actor,kGenDudeSndBurning); @@ -1013,7 +1013,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType } - if (actor->spr.type == kDudeModernCustom) + if (actor->GetType() == kDudeModernCustom) { GENDUDEEXTRA* pExtra = &actor->genDudeExtra; if (nDmgType == kDamageBurn) @@ -1226,7 +1226,7 @@ void RecoilDude(DBloodActor* actor) { uint8_t v4 = Chance(0x8000); DUDEEXTRA* pDudeExtra = &actor->dudeExtra; - if (actor->spr.statnum == kStatDude && (actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) + if (actor->spr.statnum == kStatDude && (actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); switch (actor->spr.type) @@ -1289,7 +1289,7 @@ void RecoilDude(DBloodActor* actor) case kDudeCultistTesla: case kDudeCultistTNT: case kDudeCultistBeast: - if (actor->spr.type == kDudeCultistTommy) aiPlay3DSound(actor, 4013 + Random(2), AI_SFX_PRIORITY_2, -1); + if (actor->GetType() == kDudeCultistTommy) aiPlay3DSound(actor, 4013 + Random(2), AI_SFX_PRIORITY_2, -1); else aiPlay3DSound(actor, 1013 + Random(2), AI_SFX_PRIORITY_2, -1); if (!v4 && actor->xspr.medium == kMediumNormal) @@ -1485,7 +1485,7 @@ void RecoilDude(DBloodActor* actor) void aiThinkTarget(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (Chance(pDudeInfo->alertChance)) { @@ -1530,7 +1530,7 @@ void aiThinkTarget(DBloodActor* actor) void aiLookForTarget(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (Chance(pDudeInfo->alertChance)) { @@ -1572,7 +1572,7 @@ void aiLookForTarget(DBloodActor* actor) while (DBloodActor* actor2 = it.Next()) { double nDist = (actor2->spr.pos.XY() - actor->spr.pos.XY()).Length(); - if (actor2->spr.type == kDudeInnocent) + if (actor2->GetType() == kDudeInnocent) { pDudeInfo = getDudeInfo(actor2->spr.type); if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->HearDist()) diff --git a/source/games/blood/src/aibat.cpp b/source/games/blood/src/aibat.cpp index b1579d9a6..b5039d3ea 100644 --- a/source/games/blood/src/aibat.cpp +++ b/source/games/blood/src/aibat.cpp @@ -66,7 +66,7 @@ void batBiteSeqCallback(int, DBloodActor* actor) if (!actor->ValidateTarget(__FUNCTION__)) return; auto pTarget = actor->GetTarget(); - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfoT = getDudeInfo(pTarget->spr.type); @@ -77,7 +77,7 @@ void batBiteSeqCallback(int, DBloodActor* actor) static void batThinkTarget(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats; if (pDudeExtraE->active && pDudeExtraE->thinkTime < 10) @@ -133,7 +133,7 @@ static void batThinkSearch(DBloodActor* actor) static void batThinkGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.X; auto nAngle = dvec.Angle(); @@ -151,7 +151,7 @@ static void batThinkPonder(DBloodActor* actor) aiNewState(actor, &batSearch); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto pTarget = actor->GetTarget(); @@ -198,7 +198,7 @@ static void batThinkPonder(DBloodActor* actor) static void batMoveDodgeUp(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -215,7 +215,7 @@ static void batMoveDodgeUp(DBloodActor* actor) static void batMoveDodgeDown(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -239,7 +239,7 @@ static void batThinkChase(DBloodActor* actor) aiNewState(actor, &batGoto); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto pTarget = actor->GetTarget(); @@ -296,7 +296,7 @@ static void batThinkChase(DBloodActor* actor) static void batMoveForward(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -321,7 +321,7 @@ static void batMoveForward(DBloodActor* actor) static void batMoveSwoop(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -345,7 +345,7 @@ static void batMoveSwoop(DBloodActor* actor) static void batMoveFly(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); diff --git a/source/games/blood/src/aibeast.cpp b/source/games/blood/src/aibeast.cpp index c082c0fcb..bdb3e2da4 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -101,7 +101,7 @@ void StompSeqCallback(int, DBloodActor* actor) { if (actor2->hasX()) { - if (actor2->spr.type == kDudeBeast) + if (actor2->GetType() == kDudeBeast) continue; if (actor2->spr.flags & 32) continue; @@ -170,7 +170,7 @@ static void beastThinkSearch(DBloodActor* actor) static void beastThinkGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto pSector = actor->sector(); auto pXSector = pSector->hasX() ? &pSector->xs() : nullptr; @@ -202,7 +202,7 @@ static void beastThinkChase(DBloodActor* actor) aiNewState(actor, &beastSearch); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -322,7 +322,7 @@ static void beastThinkChase(DBloodActor* actor) static void beastThinkSwimGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); auto nAngle = dvec.Angle(); @@ -340,7 +340,7 @@ static void beastThinkSwimChase(DBloodActor* actor) aiNewState(actor, &beastSwimGoto); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -389,7 +389,7 @@ static void beastThinkSwimChase(DBloodActor* actor) static void beastMoveForward(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -405,7 +405,7 @@ static void beastMoveForward(DBloodActor* actor) static void sub_628A0(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -429,7 +429,7 @@ static void sub_628A0(DBloodActor* actor) static void sub_62AE0(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -459,7 +459,7 @@ static void sub_62AE0(DBloodActor* actor) static void sub_62D7C(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); diff --git a/source/games/blood/src/aiboneel.cpp b/source/games/blood/src/aiboneel.cpp index 05bd6b720..23a780457 100644 --- a/source/games/blood/src/aiboneel.cpp +++ b/source/games/blood/src/aiboneel.cpp @@ -77,7 +77,7 @@ void eelBiteSeqCallback(int, DBloodActor* actor) } auto target = actor->GetTarget(); - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); @@ -89,7 +89,7 @@ void eelBiteSeqCallback(int, DBloodActor* actor) static void eelThinkTarget(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats; if (pDudeExtraE->active && pDudeExtraE->thinkTime < 10) @@ -146,7 +146,7 @@ static void eelThinkSearch(DBloodActor* actor) static void eelThinkGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); auto nAngle = dvec.Angle(); @@ -164,7 +164,7 @@ static void eelThinkPonder(DBloodActor* actor) aiNewState(actor, &eelSearch); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto target = actor->GetTarget(); @@ -213,7 +213,7 @@ static void eelThinkPonder(DBloodActor* actor) static void eelMoveDodgeUp(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -230,7 +230,7 @@ static void eelMoveDodgeUp(DBloodActor* actor) static void eelMoveDodgeDown(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -254,7 +254,7 @@ static void eelThinkChase(DBloodActor* actor) aiNewState(actor, &eelGoto); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto target = actor->GetTarget(); @@ -306,7 +306,7 @@ static void eelThinkChase(DBloodActor* actor) static void eelMoveForward(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -331,7 +331,7 @@ static void eelMoveForward(DBloodActor* actor) static void eelMoveSwoop(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -352,7 +352,7 @@ static void eelMoveSwoop(DBloodActor* actor) static void eelMoveAscend(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); diff --git a/source/games/blood/src/aiburn.cpp b/source/games/blood/src/aiburn.cpp index 8c8348c47..3107de087 100644 --- a/source/games/blood/src/aiburn.cpp +++ b/source/games/blood/src/aiburn.cpp @@ -82,7 +82,7 @@ static void burnThinkSearch(DBloodActor* actor) static void burnThinkGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); DAngle nAngle = dvec.Angle(); @@ -152,7 +152,7 @@ static void burnThinkChase(DBloodActor* actor) } return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto target = actor->GetTarget(); diff --git a/source/games/blood/src/aicaleb.cpp b/source/games/blood/src/aicaleb.cpp index a5778235b..bd969d38a 100644 --- a/source/games/blood/src/aicaleb.cpp +++ b/source/games/blood/src/aicaleb.cpp @@ -87,7 +87,7 @@ static void calebThinkSearch(DBloodActor* actor) static void calebThinkGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto pSector = actor->sector(); @@ -120,7 +120,7 @@ static void calebThinkChase(DBloodActor* actor) aiNewState(actor, &tinycalebSearch); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto target = actor->GetTarget(); @@ -210,7 +210,7 @@ static void calebThinkChase(DBloodActor* actor) static void calebThinkSwimGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); DAngle nAngle = dvec.Angle(); @@ -228,7 +228,7 @@ static void calebThinkSwimChase(DBloodActor* actor) aiNewState(actor, &tinycalebSwimGoto); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto target = actor->GetTarget(); @@ -274,7 +274,7 @@ static void calebThinkSwimChase(DBloodActor* actor) static void sub_65D04(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -299,7 +299,7 @@ static void sub_65D04(DBloodActor* actor) static void sub_65F44(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; @@ -327,7 +327,7 @@ static void sub_65F44(DBloodActor* actor) static void sub_661E0(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; diff --git a/source/games/blood/src/aicerber.cpp b/source/games/blood/src/aicerber.cpp index 7c23b8b3d..59265ff24 100644 --- a/source/games/blood/src/aicerber.cpp +++ b/source/games/blood/src/aicerber.cpp @@ -60,8 +60,8 @@ static constexpr double Cerberus_ZOff = 100. / 256; void cerberusBiteSeqCallback(int, DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } if (!actor->ValidateTarget(__FUNCTION__)) return; @@ -215,8 +215,8 @@ static void cerberusThinkSearch(DBloodActor* actor) static void cerberusThinkTarget(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -227,7 +227,7 @@ static void cerberusThinkTarget(DBloodActor* actor) { actor->xspr.goalAng += DAngle45; aiSetTarget(actor, actor->basePoint); - if (actor->spr.type == kDudeCerberusTwoHead) + if (actor->GetType() == kDudeCerberusTwoHead) aiNewState(actor, &cerberus139890); else aiNewState(actor, &cerberus1398AC); @@ -271,8 +271,8 @@ static void cerberusThinkTarget(DBloodActor* actor) static void cerberusThinkGoto(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -308,9 +308,9 @@ static void cerberusThinkChase(DBloodActor* actor) return; } - ///assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + ///assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } diff --git a/source/games/blood/src/aicult.cpp b/source/games/blood/src/aicult.cpp index 7b184ba3a..433d1aba6 100644 --- a/source/games/blood/src/aicult.cpp +++ b/source/games/blood/src/aicult.cpp @@ -124,7 +124,7 @@ void cultThrowSeqCallback(int, DBloodActor* actor) sfxPlay3DSound(actor, 455, -1, 0); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); auto dv = target->spr.pos - actor->spr.pos; double nDist = dv.XY().Length(); if (nDist > 0x1e0) @@ -155,7 +155,7 @@ void cultThrowSeqCallback3(int, DBloodActor* actor) sfxPlay3DSound(actor, 455, -1, 0); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); auto dv = target->spr.pos - actor->spr.pos; double nDist = dv.XY().Length(); @@ -168,7 +168,7 @@ static bool TargetNearExplosion(sectortype* sector) BloodSectIterator it(sector); while (auto actor = it.Next()) { - if (actor->spr.type == kThingArmedTNTStick || actor->spr.statnum == kStatExplosion) + if (actor->GetType() == kThingArmedTNTStick || actor->spr.statnum == kStatExplosion) return true; } return false; @@ -182,7 +182,7 @@ static void cultThinkSearch(DBloodActor* actor) static void cultThinkGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); DAngle nAngle = dvec.Angle(); @@ -220,7 +220,7 @@ static void cultThinkChase(DBloodActor* actor) } return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto target = actor->GetTarget(); @@ -235,7 +235,7 @@ static void cultThinkChase(DBloodActor* actor) { case kMediumNormal: aiNewState(actor, &cultistSearch); - if (actor->spr.type == kDudeCultistTommy) + if (actor->GetType() == kDudeCultistTommy) aiPlay3DSound(actor, 4021 + Random(4), AI_SFX_PRIORITY_1, -1); else aiPlay3DSound(actor, 1021 + Random(4), AI_SFX_PRIORITY_1, -1); diff --git a/source/games/blood/src/aigarg.cpp b/source/games/blood/src/aigarg.cpp index c157d3a27..bebdfc70b 100644 --- a/source/games/blood/src/aigarg.cpp +++ b/source/games/blood/src/aigarg.cpp @@ -174,8 +174,8 @@ void ThrowSSeqCallback(int, DBloodActor* actor) static void gargThinkTarget(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -233,8 +233,8 @@ static void gargThinkSearch(DBloodActor* actor) static void gargThinkGoto(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -249,8 +249,8 @@ static void gargThinkGoto(DBloodActor* actor) static void gargMoveDodgeUp(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -269,8 +269,8 @@ static void gargMoveDodgeUp(DBloodActor* actor) static void gargMoveDodgeDown(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -296,9 +296,9 @@ static void gargThinkChase(DBloodActor* actor) aiNewState(actor, &gargoyleFGoto); return; } - ///assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + ///assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -444,7 +444,7 @@ static void gargThinkChase(DBloodActor* actor) } else if ((heightDelta > 32 || floorDelta > 32) && nDist < 0x140 && nDist > 0x80) { - if (actor->spr.type == kDudeGargoyleFlesh) + if (actor->GetType() == kDudeGargoyleFlesh) aiPlay3DSound(actor, 1400, AI_SFX_PRIORITY_1, -1); else aiPlay3DSound(actor, 1450, AI_SFX_PRIORITY_1, -1); @@ -484,8 +484,8 @@ static void entrySStatue(DBloodActor* actor) static void gargMoveForward(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -512,8 +512,8 @@ static void gargMoveForward(DBloodActor* actor) static void gargMoveSlow(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -547,8 +547,8 @@ static void gargMoveSlow(DBloodActor* actor) static void gargMoveSwoop(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -582,8 +582,8 @@ static void gargMoveSwoop(DBloodActor* actor) static void gargMoveFly(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); diff --git a/source/games/blood/src/aighost.cpp b/source/games/blood/src/aighost.cpp index 326be2be8..4d50464de 100644 --- a/source/games/blood/src/aighost.cpp +++ b/source/games/blood/src/aighost.cpp @@ -155,8 +155,8 @@ void ghostBlastSeqCallback(int, DBloodActor* actor) static void ghostThinkTarget(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -213,8 +213,8 @@ static void ghostThinkSearch(DBloodActor* actor) static void ghostThinkGoto(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -229,8 +229,8 @@ static void ghostThinkGoto(DBloodActor* actor) static void ghostMoveDodgeUp(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -249,8 +249,8 @@ static void ghostMoveDodgeUp(DBloodActor* actor) static void ghostMoveDodgeDown(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -275,9 +275,9 @@ static void ghostThinkChase(DBloodActor* actor) aiNewState(actor, &ghostGoto); return; } - ///assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + ///assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -380,8 +380,8 @@ static void ghostThinkChase(DBloodActor* actor) static void ghostMoveForward(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -407,8 +407,8 @@ static void ghostMoveForward(DBloodActor* actor) static void ghostMoveSlow(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -438,8 +438,8 @@ static void ghostMoveSlow(DBloodActor* actor) static void ghostMoveSwoop(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -468,8 +468,8 @@ static void ghostMoveSwoop(DBloodActor* actor) static void ghostMoveFly(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); diff --git a/source/games/blood/src/aigilbst.cpp b/source/games/blood/src/aigilbst.cpp index cef9bab42..72b6e581e 100644 --- a/source/games/blood/src/aigilbst.cpp +++ b/source/games/blood/src/aigilbst.cpp @@ -77,7 +77,7 @@ static void gillThinkSearch(DBloodActor* actor) static void gillThinkGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto pSector = actor->sector(); @@ -110,7 +110,7 @@ static void gillThinkChase(DBloodActor* actor) aiNewState(actor, &gillBeastSearch); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -194,7 +194,7 @@ static void gillThinkChase(DBloodActor* actor) static void gillThinkSwimGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); DAngle nAngle = dvec.Angle(); @@ -212,7 +212,7 @@ static void gillThinkSwimChase(DBloodActor* actor) aiNewState(actor, &gillBeastSwimSearch); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -262,7 +262,7 @@ static void gillThinkSwimChase(DBloodActor* actor) static void sub_6CB00(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nTurnRange = pDudeInfo->TurnRange(); @@ -287,7 +287,7 @@ static void sub_6CB00(DBloodActor* actor) static void sub_6CD74(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -314,7 +314,7 @@ static void sub_6CD74(DBloodActor* actor) static void sub_6D03C(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); diff --git a/source/games/blood/src/aihand.cpp b/source/games/blood/src/aihand.cpp index 2dda123bd..816d046cd 100644 --- a/source/games/blood/src/aihand.cpp +++ b/source/games/blood/src/aihand.cpp @@ -64,7 +64,7 @@ static void handThinkSearch(DBloodActor* actor) static void handThinkGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); DAngle nAngle = dvec.Angle(); @@ -82,7 +82,7 @@ static void handThinkChase(DBloodActor* actor) aiNewState(actor, &handGoto); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); diff --git a/source/games/blood/src/aihound.cpp b/source/games/blood/src/aihound.cpp index 0cd8c076f..37db6b9c4 100644 --- a/source/games/blood/src/aihound.cpp +++ b/source/games/blood/src/aihound.cpp @@ -44,8 +44,8 @@ AISTATE houndBurn = { kAiStateChase, 7, nHoundBurnClient, 60, NULL, NULL, NULL, void houndBiteSeqCallback(int, DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } @@ -69,8 +69,8 @@ static void houndThinkSearch(DBloodActor* actor) static void houndThinkGoto(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } @@ -91,8 +91,8 @@ static void houndThinkChase(DBloodActor* actor) aiNewState(actor, &houndGoto); return; } - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); diff --git a/source/games/blood/src/aiinnoc.cpp b/source/games/blood/src/aiinnoc.cpp index ab7326ac0..0f4f00941 100644 --- a/source/games/blood/src/aiinnoc.cpp +++ b/source/games/blood/src/aiinnoc.cpp @@ -48,7 +48,7 @@ static void innocThinkSearch(DBloodActor* actor) static void innocThinkGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); DAngle nAngle = dvec.Angle(); @@ -66,7 +66,7 @@ static void innocThinkChase(DBloodActor* actor) aiNewState(actor, &innocentGoto); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); diff --git a/source/games/blood/src/aipod.cpp b/source/games/blood/src/aipod.cpp index 239500a9d..dfeaefd28 100644 --- a/source/games/blood/src/aipod.cpp +++ b/source/games/blood/src/aipod.cpp @@ -130,8 +130,8 @@ static void aiPodSearch(DBloodActor* actor) static void aiPodMove(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } @@ -171,8 +171,8 @@ static void aiPodChase(DBloodActor* actor) } return; } - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); diff --git a/source/games/blood/src/airat.cpp b/source/games/blood/src/airat.cpp index bd296888a..395851d1e 100644 --- a/source/games/blood/src/airat.cpp +++ b/source/games/blood/src/airat.cpp @@ -43,7 +43,7 @@ AISTATE ratBite = { kAiStateChase, 6, nRatBiteClient, 120, NULL, NULL, NULL, &ra void ratBiteSeqCallback(int, DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); if (target->IsPlayerActor()) @@ -61,7 +61,7 @@ static void ratThinkSearch(DBloodActor* actor) static void ratThinkGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); DAngle nAngle = dvec.Angle(); @@ -79,7 +79,7 @@ static void ratThinkChase(DBloodActor* actor) aiNewState(actor, &ratGoto); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto target = actor->GetTarget(); diff --git a/source/games/blood/src/aispid.cpp b/source/games/blood/src/aispid.cpp index 5f4f24ad0..6d4c2a4df 100644 --- a/source/games/blood/src/aispid.cpp +++ b/source/games/blood/src/aispid.cpp @@ -64,7 +64,7 @@ void SpidBiteSeqCallback(int, DBloodActor* actor) vec.X += Random2F(2000, 14); vec.Y += Random2F(2000, 14); vec.Z = Random2F(2000, 14); - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); if (!actor->ValidateTarget(__FUNCTION__)) return; auto const target = actor->GetTarget(); @@ -113,7 +113,7 @@ void SpidJumpSeqCallback(int, DBloodActor* actor) vec.Y += Random2F(200, 14); vec.Z = Random2F(200, 14); - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); if (target->IsPlayerActor()) { @@ -131,7 +131,7 @@ void SpidJumpSeqCallback(int, DBloodActor* actor) void SpidBirthSeqCallback(int, DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -169,7 +169,7 @@ static void spidThinkSearch(DBloodActor* actor) static void spidThinkGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); DAngle nAngle = dvec.Angle(); @@ -187,7 +187,7 @@ static void spidThinkChase(DBloodActor* actor) aiNewState(actor, &spidGoto); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto target = actor->GetTarget(); diff --git a/source/games/blood/src/aitchern.cpp b/source/games/blood/src/aitchern.cpp index 8cf17729e..a1990c4b1 100644 --- a/source/games/blood/src/aitchern.cpp +++ b/source/games/blood/src/aitchern.cpp @@ -179,8 +179,8 @@ static void sub_72580(DBloodActor* actor) static void sub_725A4(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -234,8 +234,8 @@ static void sub_725A4(DBloodActor* actor) static void sub_72850(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -255,8 +255,8 @@ static void tchernobogThinkChase(DBloodActor* actor) aiNewState(actor, &tcherno13A9B8); return; } - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index 511241630..3952ddd93 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -295,7 +295,7 @@ static void ThrowThing(DBloodActor* actor, bool impact) if (target == nullptr) return; - if (!(target->spr.type >= kDudeBase && target->spr.type < kDudeMax)) + if (!(target->GetType() >= kDudeBase && target->GetType() < kDudeMax)) return; int curWeapon = actor->genDudeExtra.curWeapon; @@ -409,9 +409,9 @@ static void unicultThinkSearch(DBloodActor* actor) static void unicultThinkGoto(DBloodActor* actor) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } @@ -437,7 +437,7 @@ static void unicultThinkGoto(DBloodActor* actor) static void unicultThinkChase(DBloodActor* actor) { - if (actor->spr.type < kDudeBase || actor->spr.type >= kDudeMax) return; + if (actor->GetType() < kDudeBase || actor->GetType() >= kDudeMax) return; auto const target = actor->GetTarget(); if (target == nullptr) @@ -1160,9 +1160,9 @@ void aiGenDudeMoveForward(DBloodActor* actor) void aiGenDudeChooseDirection(DBloodActor* actor, DAngle direction, const DVector2& vel) { - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax)) + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax"); + Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); return; } diff --git a/source/games/blood/src/aizomba.cpp b/source/games/blood/src/aizomba.cpp index b230b9214..e700abc65 100644 --- a/source/games/blood/src/aizomba.cpp +++ b/source/games/blood/src/aizomba.cpp @@ -88,7 +88,7 @@ static void zombaThinkSearch(DBloodActor* actor) static void zombaThinkGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); DAngle nAngle = dvec.Angle(); @@ -106,7 +106,7 @@ static void zombaThinkChase(DBloodActor* actor) aiNewState(actor, &zombieASearch); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -127,7 +127,7 @@ static void zombaThinkChase(DBloodActor* actor) return; } // If the zombie gets whacked while rising from the grave it never executes this change and if it isn't done here at the very latest, will just aimlessly run around. - if (!VanillaMode() && actor->spr.type == kDudeZombieAxeBuried) + if (!VanillaMode() && actor->GetType() == kDudeZombieAxeBuried) actor->ChangeType(kDudeZombieAxeNormal); @@ -158,7 +158,7 @@ static void zombaThinkPonder(DBloodActor* actor) aiNewState(actor, &zombieASearch); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -205,7 +205,7 @@ static void zombaThinkPonder(DBloodActor* actor) static void myThinkTarget(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); for (int p = connecthead; p >= 0; p = connectpoint2[p]) { diff --git a/source/games/blood/src/aizombf.cpp b/source/games/blood/src/aizombf.cpp index f519c0075..eff5c57a5 100644 --- a/source/games/blood/src/aizombf.cpp +++ b/source/games/blood/src/aizombf.cpp @@ -88,7 +88,7 @@ static void zombfThinkSearch(DBloodActor* actor) static void zombfThinkGoto(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); DAngle nAngle = dvec.Angle(); @@ -106,7 +106,7 @@ static void zombfThinkChase(DBloodActor* actor) aiNewState(actor, &zombieFGoto); return; } - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); diff --git a/source/games/blood/src/bloodactor.h b/source/games/blood/src/bloodactor.h index b5543f41c..30d7ec2a3 100644 --- a/source/games/blood/src/bloodactor.h +++ b/source/games/blood/src/bloodactor.h @@ -95,12 +95,12 @@ public: bool IsPlayerActor() { - return spr.type >= kDudePlayer1 && spr.type <= kDudePlayer8; + return GetType() >= kDudePlayer1 && GetType() <= kDudePlayer8; } bool IsDudeActor() { - return spr.type >= kDudeBase && spr.type < kDudeMax; + return GetType() >= kDudeBase && GetType() < kDudeMax; } bool IsThingActor() @@ -157,12 +157,11 @@ public: { spr.type = newtype; } - + int GetType() const { return spr.type; } - }; // subclassed to add a game specific actor() method diff --git a/source/games/blood/src/callback.cpp b/source/games/blood/src/callback.cpp index a71c6c836..abb223619 100644 --- a/source/games/blood/src/callback.cpp +++ b/source/games/blood/src/callback.cpp @@ -314,7 +314,7 @@ void Respawn(DBloodActor* actor, sectortype*) // 9 aiInitSprite(actor); actor->xspr.key = 0; } - else if (actor->spr.type == kThingTNTBarrel) { + else if (actor->GetType() == kThingTNTBarrel) { actor->spr.cstat |= CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN; actor->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE; } @@ -650,9 +650,9 @@ void fxPodBloodSplat(DBloodActor* actor, sectortype*) // 19 sfxPlay3DSound(actor, 385, nChannel, 1); } DBloodActor* pFX = NULL; - if (actor->spr.type == 53 || actor->spr.type == kThingPodGreenBall) + if (actor->spr.type == 53 || actor->GetType() == kThingPodGreenBall) { - if (Chance(0x500) || actor->spr.type == kThingPodGreenBall) + if (Chance(0x500) || actor->GetType() == kThingPodGreenBall) pFX = gFX.fxSpawnActor(FX_55, actor->sector(), DVector3(pos, floorZ - 0.25)); if (pFX) pFX->spr.Angles.Yaw = nAngle; diff --git a/source/games/blood/src/fx.cpp b/source/games/blood/src/fx.cpp index aaba85964..63815c9c2 100644 --- a/source/games/blood/src/fx.cpp +++ b/source/games/blood/src/fx.cpp @@ -301,7 +301,7 @@ void fxSpawnPodStuff(DBloodActor* actor, int) if (adult_lockout && gGameOptions.nGameType <= 0) return; DBloodActor* spawnactor; - if (actor->spr.type == kDudePodGreen) + if (actor->GetType() == kDudePodGreen) spawnactor = gFX.fxSpawnActor(FX_53, actor->sector(), actor->spr.pos); else spawnactor = gFX.fxSpawnActor(FX_54, actor->sector(), actor->spr.pos); diff --git a/source/games/blood/src/loadsave.cpp b/source/games/blood/src/loadsave.cpp index 13c08ba61..e9727b054 100644 --- a/source/games/blood/src/loadsave.cpp +++ b/source/games/blood/src/loadsave.cpp @@ -493,7 +493,7 @@ void DBloodActor::Serialize(FSerializer& arc) // GenDudeExtra only contains valid info for kDudeModernCustom and kDudeModernCustomBurning so only save when needed as these are not small. - if (spr.type == kDudeModernCustom || spr.type == kDudeModernCustomBurning) + if (GetType() == kDudeModernCustom || GetType() == kDudeModernCustomBurning) { arc("gendudeextra", genDudeExtra); } diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 0fa7e30a1..5b96b037a 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -339,7 +339,7 @@ bool nnExtIsImmune(DBloodActor* actor, int dmgType, int minScale) else if (actor->IsDudeActor()) { if (actor->IsPlayerActor()) return (gPlayer[actor->spr.type - kDudePlayer1].damageControl[dmgType]); - else if (actor->spr.type == kDudeModernCustom) return (actor->genDudeExtra.dmgControl[dmgType] <= minScale); + else if (actor->GetType() == kDudeModernCustom) return (actor->genDudeExtra.dmgControl[dmgType] <= minScale); else return (getDudeInfo(actor->spr.type)->damageVal[dmgType] <= minScale); } } @@ -2448,7 +2448,7 @@ void useObjResizer(DBloodActor* sourceactor, int targType, sectortype* targSect, } } - if (fit && (targetactor->spr.type == kDudeModernCustom || targetactor->spr.type == kDudeModernCustomBurning)) + if (fit && (targetactor->GetType() == kDudeModernCustom || targetactor->GetType() == kDudeModernCustomBurning)) { // request properties update for custom dude @@ -4403,7 +4403,7 @@ bool condCheckDude(DBloodActor* aCond, int cmpOp, bool PUSH) auto objActor = eob.actor(); - if (!objActor->hasX() || objActor->spr.type == kThingBloodChunks) + if (!objActor->hasX() || objActor->GetType() == kThingBloodChunks) condError(aCond, "Sprite #%d is dead!", objActor->GetIndex()); if (!objActor->IsDudeActor() || objActor->IsPlayerActor()) @@ -4686,7 +4686,7 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH) default: break; case 50: // compare hp (in %) if (objActor->IsDudeActor()) var = (objActor->xspr.sysData2 > 0) ? ClipRange(objActor->xspr.sysData2 << 4, 1, 65535) : getDudeInfo(objActor->spr.type)->startHealth << 4; - else if (objActor->spr.type == kThingBloodChunks) return condCmp(0, arg1, arg2, cmpOp); + else if (objActor->GetType() == kThingBloodChunks) return condCmp(0, arg1, arg2, cmpOp); else if (objActor->spr.type >= kThingBase && objActor->spr.type < kThingMax) var = thingInfo[objActor->spr.type - kThingBase].startHealth << 4; return condCmp((kPercFull * objActor->xspr.health) / ClipLow(var, 1), arg1, arg2, cmpOp); case 55: // touching ceil of sector? @@ -5318,7 +5318,7 @@ bool aiFightUnitCanFly(DBloodActor* dude) bool aiFightIsMeleeUnit(DBloodActor* dude) { - if (dude->spr.type == kDudeModernCustom) return (dude->hasX() && dudeIsMelee(dude)); + if (dude->GetType() == kDudeModernCustom) return (dude->hasX() && dudeIsMelee(dude)); else return (dude->IsDudeActor() && gDudeInfoExtra[dude->spr.type - kDudeBase].melee); } @@ -6976,13 +6976,13 @@ void useTargetChanger(DBloodActor* sourceactor, DBloodActor* actor) { aiSetTarget(actor, actor->spr.pos); aiSetGenIdleState(actor); - if (actor->spr.type == kDudeModernCustom && actLeech) + if (actor->GetType() == kDudeModernCustom && actLeech) removeLeech(actLeech); } else if (sourceactor->xspr.data4 == 4) { aiSetTarget(actor, playeractor->spr.pos); - if (actor->spr.type == kDudeModernCustom && actLeech) + if (actor->GetType() == kDudeModernCustom && actLeech) removeLeech(actLeech); } } @@ -7696,7 +7696,7 @@ bool nnExtCanMove(DBloodActor* actor, DBloodActor* target, DAngle nAngle, double void nnExtAiSetDirection(DBloodActor* actor, DAngle direction) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DAngle vc = deltaangle(actor->spr.Angles.Yaw, direction); DAngle v8 = vc > nullAngle ? DAngle180 / 3 : -DAngle180 / 3; @@ -7737,7 +7737,7 @@ void nnExtAiSetDirection(DBloodActor* actor, DAngle direction) void aiPatrolState(DBloodActor* actor, int state) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax&& actor->hasX()); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax&& actor->hasX()); assert(actor->GetTarget()); auto markeractor = actor->GetTarget(); @@ -7792,7 +7792,7 @@ void aiPatrolState(DBloodActor* actor, int state) if (markeractor->xspr.data4 > 0) seq = markeractor->xspr.data4, nSeqOverride = true; - else if (!nSeqOverride && state == kAiStatePatrolWaitC && (actor->spr.type == kDudeCultistTesla || actor->spr.type == kDudeCultistTNT)) + else if (!nSeqOverride && state == kAiStatePatrolWaitC && (actor->GetType() == kDudeCultistTesla || actor->GetType() == kDudeCultistTNT)) seq = 11537, nSeqOverride = true; // these don't have idle crouch seq for some reason... if (seq < 0) @@ -7804,7 +7804,7 @@ void aiPatrolState(DBloodActor* actor, int state) if (newState->stateType != state || (!nSeqOverride && seq != newState->seqId)) continue; - if (actor->spr.type == kDudeModernCustom) aiGenDudeNewState(actor, newState); + if (actor->GetType() == kDudeModernCustom) aiGenDudeNewState(actor, newState); else aiNewState(actor, newState); if (crouch) actor->xspr.unused1 |= kDudeFlagCrouch; @@ -7852,7 +7852,7 @@ DBloodActor* aiPatrolMarkerBusy(DBloodActor* except, DBloodActor* marker) bool aiPatrolMarkerReached(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); const DUDEINFO_EXTRA* pExtra = &gDudeInfoExtra[actor->spr.type - kDudeBase]; auto markeractor = actor->GetTarget(); @@ -8123,7 +8123,7 @@ void aiPatrolMove(DBloodActor* actor) { auto targetactor = actor->GetTarget(); - if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax) || !targetactor) + if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax) || !targetactor) return; @@ -8342,9 +8342,9 @@ bool spritesTouching(DBloodActor* actor1, DBloodActor* actor2) bool aiCanCrouch(DBloodActor* actor) { - if (actor->spr.type >= kDudeBase && actor->spr.type < kDudeVanillaMax) + if (actor->GetType() >= kDudeBase && actor->GetType() < kDudeVanillaMax) return (gDudeInfoExtra[actor->spr.type - kDudeBase].idlcseqofs >= 0 && gDudeInfoExtra[actor->spr.type - kDudeBase].mvecseqofs >= 0); - else if (actor->spr.type == kDudeModernCustom || actor->spr.type == kDudeModernCustomBurning) + else if (actor->GetType() == kDudeModernCustom || actor->GetType() == kDudeModernCustomBurning) return actor->genDudeExtra.canDuck; return false; @@ -8359,7 +8359,7 @@ bool aiCanCrouch(DBloodActor* actor) bool readyForCrit(DBloodActor* hunter, DBloodActor* victim) { - if (!(hunter->spr.type >= kDudeBase && hunter->spr.type < kDudeMax) || !(victim->spr.type >= kDudeBase && victim->spr.type < kDudeMax)) + if (!(hunter->GetType() >= kDudeBase && hunter->GetType() < kDudeMax) || !(victim->GetType() >= kDudeBase && victim->GetType() < kDudeMax)) return false; auto dvect = victim->spr.pos.XY() - hunter->spr.pos.XY(); @@ -8380,7 +8380,7 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor) enum { kMaxPatrolFoundSounds = 256 }; // should be the maximum amount of sound channels the engine can play at the same time. PATROL_FOUND_SOUNDS patrolBonkles[kMaxPatrolFoundSounds]; - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); PLAYER* pPlayer = NULL; for (int i = 0; i < kMaxPatrolFoundSounds; i++) @@ -8761,7 +8761,7 @@ bool aiPatrolGetPathDir(DBloodActor* actor, DBloodActor* marker) void aiPatrolThink(DBloodActor* actor) { - assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); + assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); DBloodActor* targetactor; unsigned int stateTimer; @@ -8774,7 +8774,7 @@ void aiPatrolThink(DBloodActor* actor) bool crouch = (actor->xspr.unused1 & kDudeFlagCrouch), uwater = spriteIsUnderwater(actor); - if (markeractor == nullptr || (actor->spr.type == kDudeModernCustom && ((uwater && !canSwim(actor)) || !canWalk(actor)))) + if (markeractor == nullptr || (actor->GetType() == kDudeModernCustom && ((uwater && !canSwim(actor)) || !canWalk(actor)))) { aiPatrolStop(actor, nullptr); return; diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 440afb224..4adba798d 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -1011,7 +1011,7 @@ bool findDroppedLeech(PLAYER* a1, DBloodActor* a2) { if (a2 == actor) continue; - if (actor->spr.type == kThingDroppedLifeLeech && actor->GetOwner() == a1->actor) + if (actor->GetType() == kThingDroppedLifeLeech && actor->GetOwner() == a1->actor) return 1; } return 0; @@ -1435,7 +1435,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out) out->hitActor = hitactor; if (hitactor->spr.statnum == kStatThing) { - if (hitactor->spr.type == kThingDroppedLifeLeech) + if (hitactor->GetType() == kThingDroppedLifeLeech) { if (gGameOptions.nGameType > 1 && findDroppedLeech(pPlayer, hitactor)) return -1; diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 41f5d523f..81a744d9c 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -324,7 +324,7 @@ void OperateSprite(DBloodActor* actor, EVENT event) return; } - if (actor->spr.statnum == kStatDude && actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax) { + if (actor->spr.statnum == kStatDude && actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax) { switch (event.cmd) { case kCmdOff: