diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index b92c273ed..68d0ca70b 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -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->GetType() >= kDudeBase && actor->GetType() < kDudeMax&& actor->hasX()); + assert(actor->IsDudeActor()&& actor->hasX()); int nType = actor->spr.type - kDudeBase; if (actKillDudeStage1(actor, damageType)) return; @@ -4693,9 +4693,9 @@ void MoveDude(DBloodActor* actor) { PLAYER* pPlayer = nullptr; if (actor->IsPlayerActor()) pPlayer = &gPlayer[actor->spr.type - kDudePlayer1]; - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) + if (!(actor->IsDudeActor())) { - Printf(PRINT_HIGH, "%d: actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax", actor->spr.type); + Printf(PRINT_HIGH, "%d: actor->IsDudeActor()", actor->spr.type); return; } @@ -6569,7 +6569,7 @@ bool actCheckRespawn(DBloodActor* actor) actPostSprite(actor, kStatRespawn); actor->spr.flags |= kHitagRespawn; - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) + if (!(actor->IsDudeActor())) { 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 68be52eab..e687b7cc8 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax) + if (actor->spr.statnum == kStatDude && actor->IsDudeActor()) { 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); if (!actor->xspr.state) { aiChooseDirection(actor, (actor->xspr.TargetPos - actor->spr.pos).Angle()); @@ -1226,7 +1226,7 @@ void RecoilDude(DBloodActor* actor) { uint8_t v4 = Chance(0x8000); DUDEEXTRA* pDudeExtra = &actor->dudeExtra; - if (actor->spr.statnum == kStatDude && (actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) + if (actor->spr.statnum == kStatDude && (actor->IsDudeActor())) { DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); switch (actor->spr.type) @@ -1485,7 +1485,7 @@ void RecoilDude(DBloodActor* actor) void aiThinkTarget(DBloodActor* actor) { - assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (Chance(pDudeInfo->alertChance)) { @@ -1530,7 +1530,7 @@ void aiThinkTarget(DBloodActor* actor) void aiLookForTarget(DBloodActor* actor) { - assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (Chance(pDudeInfo->alertChance)) { diff --git a/source/games/blood/src/aibat.cpp b/source/games/blood/src/aibat.cpp index b5039d3ea..689af5568 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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 bdb3e2da4..251dddee9 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -170,7 +170,7 @@ static void beastThinkSearch(DBloodActor* actor) static void beastThinkGoto(DBloodActor* actor) { - assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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 23a780457..c5c8f5082 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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 3107de087..a4391ae8a 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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 bd969d38a..7fd1716e4 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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 59265ff24..fcdcad602 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } if (!actor->ValidateTarget(__FUNCTION__)) return; @@ -215,8 +215,8 @@ static void cerberusThinkSearch(DBloodActor* actor) static void cerberusThinkTarget(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -271,8 +271,8 @@ static void cerberusThinkTarget(DBloodActor* actor) static void cerberusThinkGoto(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -308,9 +308,9 @@ static void cerberusThinkChase(DBloodActor* actor) return; } - ///assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + ///assert(actor->IsDudeActor()); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } diff --git a/source/games/blood/src/aicult.cpp b/source/games/blood/src/aicult.cpp index 433d1aba6..c06203a3e 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); auto dv = target->spr.pos - actor->spr.pos; double nDist = dv.XY().Length(); @@ -182,7 +182,7 @@ static void cultThinkSearch(DBloodActor* actor) static void cultThinkGoto(DBloodActor* actor) { - assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); auto target = actor->GetTarget(); diff --git a/source/games/blood/src/aigarg.cpp b/source/games/blood/src/aigarg.cpp index bebdfc70b..56fd0ad15 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -233,8 +233,8 @@ static void gargThinkSearch(DBloodActor* actor) static void gargThinkGoto(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -249,8 +249,8 @@ static void gargThinkGoto(DBloodActor* actor) static void gargMoveDodgeUp(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -269,8 +269,8 @@ static void gargMoveDodgeUp(DBloodActor* actor) static void gargMoveDodgeDown(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -296,9 +296,9 @@ static void gargThinkChase(DBloodActor* actor) aiNewState(actor, &gargoyleFGoto); return; } - ///assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + ///assert(actor->IsDudeActor()); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -484,8 +484,8 @@ static void entrySStatue(DBloodActor* actor) static void gargMoveForward(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -512,8 +512,8 @@ static void gargMoveForward(DBloodActor* actor) static void gargMoveSlow(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -547,8 +547,8 @@ static void gargMoveSlow(DBloodActor* actor) static void gargMoveSwoop(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -582,8 +582,8 @@ static void gargMoveSwoop(DBloodActor* actor) static void gargMoveFly(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); diff --git a/source/games/blood/src/aighost.cpp b/source/games/blood/src/aighost.cpp index 4d50464de..6400126f1 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -213,8 +213,8 @@ static void ghostThinkSearch(DBloodActor* actor) static void ghostThinkGoto(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -229,8 +229,8 @@ static void ghostThinkGoto(DBloodActor* actor) static void ghostMoveDodgeUp(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -249,8 +249,8 @@ static void ghostMoveDodgeUp(DBloodActor* actor) static void ghostMoveDodgeDown(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -275,9 +275,9 @@ static void ghostThinkChase(DBloodActor* actor) aiNewState(actor, &ghostGoto); return; } - ///assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + ///assert(actor->IsDudeActor()); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -380,8 +380,8 @@ static void ghostThinkChase(DBloodActor* actor) static void ghostMoveForward(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -407,8 +407,8 @@ static void ghostMoveForward(DBloodActor* actor) static void ghostMoveSlow(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -438,8 +438,8 @@ static void ghostMoveSlow(DBloodActor* actor) static void ghostMoveSwoop(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -468,8 +468,8 @@ static void ghostMoveSwoop(DBloodActor* actor) static void ghostMoveFly(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); diff --git a/source/games/blood/src/aigilbst.cpp b/source/games/blood/src/aigilbst.cpp index 72b6e581e..35b41c928 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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 816d046cd..8ad54f309 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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 37db6b9c4..aea2ed1b2 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } @@ -69,8 +69,8 @@ static void houndThinkSearch(DBloodActor* actor) static void houndThinkGoto(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } @@ -91,8 +91,8 @@ static void houndThinkChase(DBloodActor* actor) aiNewState(actor, &houndGoto); return; } - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); diff --git a/source/games/blood/src/aiinnoc.cpp b/source/games/blood/src/aiinnoc.cpp index 0f4f00941..d121de745 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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 dfeaefd28..0f346d183 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } @@ -171,8 +171,8 @@ static void aiPodChase(DBloodActor* actor) } return; } - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); diff --git a/source/games/blood/src/airat.cpp b/source/games/blood/src/airat.cpp index 395851d1e..438295c0a 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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 6d4c2a4df..10c41922b 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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 a1990c4b1..770f60d96 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); @@ -255,8 +255,8 @@ static void tchernobogThinkChase(DBloodActor* actor) aiNewState(actor, &tcherno13A9B8); return; } - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + if (!(actor->IsDudeActor())) { + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index 3952ddd93..23cf44581 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -409,9 +409,9 @@ static void unicultThinkSearch(DBloodActor* actor) static void unicultThinkGoto(DBloodActor* actor) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) + if (!(actor->IsDudeActor())) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } @@ -1160,9 +1160,9 @@ void aiGenDudeMoveForward(DBloodActor* actor) void aiGenDudeChooseDirection(DBloodActor* actor, DAngle direction, const DVector2& vel) { - if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax)) + if (!(actor->IsDudeActor())) { - Printf(PRINT_HIGH, "actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax"); + Printf(PRINT_HIGH, "actor->IsDudeActor()"); return; } diff --git a/source/games/blood/src/aizomba.cpp b/source/games/blood/src/aizomba.cpp index e700abc65..ced433d2b 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); @@ -158,7 +158,7 @@ static void zombaThinkPonder(DBloodActor* actor) aiNewState(actor, &zombieASearch); return; } - assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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 eff5c57a5..1c4576ce6 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); if (!actor->ValidateTarget(__FUNCTION__)) return; auto target = actor->GetTarget(); diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 5b96b037a..456b38e84 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -7696,7 +7696,7 @@ bool nnExtCanMove(DBloodActor* actor, DBloodActor* target, DAngle nAngle, double void nnExtAiSetDirection(DBloodActor* actor, DAngle direction) { - assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax&& actor->hasX()); + assert(actor->IsDudeActor()&& actor->hasX()); assert(actor->GetTarget()); auto markeractor = actor->GetTarget(); @@ -7852,7 +7852,7 @@ DBloodActor* aiPatrolMarkerBusy(DBloodActor* except, DBloodActor* marker) bool aiPatrolMarkerReached(DBloodActor* actor) { - assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax) || !targetactor) + if (!(actor->IsDudeActor()) || !targetactor) return; @@ -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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax); + assert(actor->IsDudeActor()); DBloodActor* targetactor; unsigned int stateTimer; diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 81a744d9c..60312f9fb 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->GetType() >= kDudeBase && actor->GetType() < kDudeMax) { + if (actor->spr.statnum == kStatDude && actor->IsDudeActor()) { switch (event.cmd) { case kCmdOff: