quick replacements of many spr.type uses

This commit is contained in:
Christoph Oelckers 2023-09-30 10:12:36 +02:00
parent 95290c65b2
commit b2582dcb84
29 changed files with 210 additions and 211 deletions

View file

@ -2556,7 +2556,7 @@ static void ConcussSprite(DBloodActor* source, DBloodActor* actor, const DVector
{ {
mass = getDudeInfo(actor->spr.type)->mass; mass = getDudeInfo(actor->spr.type)->mass;
#ifdef NOONE_EXTENSIONS #ifdef NOONE_EXTENSIONS
if (actor->spr.type == kDudeModernCustom || actor->spr.type == kDudeModernCustomBurning) if (actor->GetType() == kDudeModernCustom || actor->GetType() == kDudeModernCustomBurning)
{ {
mass = getSpriteMassBySize(actor); 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) 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; int nType = actor->spr.type - kDudeBase;
if (actKillDudeStage1(actor, damageType)) return; 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 nType = actor->spr.type - kDudeBase;
int nDamageFactor = getDudeInfo(nType + kDudeBase)->damageVal[damageType]; int nDamageFactor = getDudeInfo(nType + kDudeBase)->damageVal[damageType];
#ifdef NOONE_EXTENSIONS #ifdef NOONE_EXTENSIONS
if (actor->spr.type == kDudeModernCustom) if (actor->GetType() == kDudeModernCustom)
nDamageFactor = actor->genDudeExtra.dmgControl[damageType]; nDamageFactor = actor->genDudeExtra.dmgControl[damageType];
#endif #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; actor->xspr.stateTimer = actor->xspr.data4 = actor->xspr.isTriggered = 0;
#ifdef NOONE_EXTENSIONS #ifdef NOONE_EXTENSIONS
if (Owner && Owner->spr.type == kDudeModernCustom) if (Owner && Owner->GetType() == kDudeModernCustom)
Owner->SetSpecialOwner(); // indicates if custom dude had life leech. Owner->SetSpecialOwner(); // indicates if custom dude had life leech.
#endif #endif
break; break;
@ -3905,7 +3905,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode)
case kMissileFireballNapalm: case kMissileFireballNapalm:
if (hitCode == 3 && actorHit && (pThingInfo || pDudeInfo)) 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); evPostActor(actorHit, 0, kCallbackFXFlameLick);
int nDamage = (50 + Random(50)) << 4; 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 && 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); evPostActor(actorHit, 0, kCallbackFXFlameLick);
actBurnSprite(missileOwner, actorHit, 480); actBurnSprite(missileOwner, actorHit, 480);
@ -4556,7 +4556,7 @@ static Collision MoveThing(DBloodActor* actor)
{ {
actor->spr.pos.Z += FixedToFloat<8>(455); actor->spr.pos.Z += FixedToFloat<8>(455);
actor->vel.Z += FixedToFloat(58254); 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); auto* fxActor = gFX.fxSpawnActor(FX_27, actor->sector(), actor->spr.pos);
if (fxActor) if (fxActor)
@ -4693,9 +4693,9 @@ void MoveDude(DBloodActor* actor)
{ {
PLAYER* pPlayer = nullptr; PLAYER* pPlayer = nullptr;
if (actor->IsPlayerActor()) pPlayer = &gPlayer[actor->spr.type - kDudePlayer1]; 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; return;
} }
@ -5018,7 +5018,7 @@ void MoveDude(DBloodActor* actor)
#ifdef NOONE_EXTENSIONS #ifdef NOONE_EXTENSIONS
if (gModernMap) { if (gModernMap) {
if (actor->spr.type == kDudeModernCustom) { if (actor->GetType() == kDudeModernCustom) {
evPostActor(actor, 0, kCallbackEnemeyBubble); evPostActor(actor, 0, kCallbackEnemeyBubble);
if (!canSwim(actor)) actKillDude(actor, actor, kDamageFall, 1000 << 4); if (!canSwim(actor)) actKillDude(actor, actor, kDamageFall, 1000 << 4);
@ -5520,7 +5520,7 @@ static void actCheckProximity()
continue; continue;
#endif #endif
if (actor->spr.type == kThingDroppedLifeLeech) actor->SetTarget(nullptr); if (actor->GetType() == kThingDroppedLifeLeech) actor->SetTarget(nullptr);
BloodStatIterator it1(kStatDude); BloodStatIterator it1(kStatDude);
while (auto dudeactor = it1.Next()) while (auto dudeactor = it1.Next())
{ {
@ -5538,7 +5538,7 @@ static void actCheckProximity()
if (actor->spr.type == kModernThingEnemyLifeLeech) proxyDist = 512; if (actor->spr.type == kModernThingEnemyLifeLeech) proxyDist = 512;
#endif #endif
if (actor->spr.type == kThingDroppedLifeLeech && actor->GetTarget() == nullptr) if (actor->GetType() == kThingDroppedLifeLeech && actor->GetTarget() == nullptr)
{ {
auto Owner = actor->GetOwner(); auto Owner = actor->GetOwner();
if (!Owner->IsPlayerActor()) continue; if (!Owner->IsPlayerActor()) continue;
@ -5546,7 +5546,7 @@ static void actCheckProximity()
PLAYER* pPlayer = &gPlayer[Owner->spr.type - kDudePlayer1]; PLAYER* pPlayer = &gPlayer[Owner->spr.type - kDudePlayer1];
PLAYER* pPlayer2 = dudeactor->IsPlayerActor() ? &gPlayer[dudeactor->spr.type - kDudePlayer1] : nullptr; 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 == 3 && pPlayer2 && pPlayer->teamId == pPlayer2->teamId) continue;
if (gGameOptions.nGameType == 1 && pPlayer2) continue; if (gGameOptions.nGameType == 1 && pPlayer2) continue;
proxyDist = 512; proxyDist = 512;
@ -5792,7 +5792,7 @@ static void actCheckExplosion()
if (pExplodeInfo->burnTime) if (pExplodeInfo->burnTime)
{ {
if (thingactor->spr.type == kThingTNTBarrel && !thingactor->xspr.burnTime) if (thingactor->GetType() == kThingTNTBarrel && !thingactor->xspr.burnTime)
evPostActor(thingactor, 0, kCallbackFXFlameLick); evPostActor(thingactor, 0, kCallbackFXFlameLick);
actBurnSprite(Owner, thingactor, pExplodeInfo->burnTime << 2); actBurnSprite(Owner, thingactor, pExplodeInfo->burnTime << 2);
} }
@ -5943,13 +5943,13 @@ static void actCheckDudes()
#ifdef NOONE_EXTENSIONS #ifdef NOONE_EXTENSIONS
// handle incarnations of custom dude // 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(); actor->vel.XY().Zero();
if (seqGetStatus(actor) < 0) genDudeTransform(actor); if (seqGetStatus(actor) < 0) genDudeTransform(actor);
} }
#endif #endif
if (actor->spr.type == kDudeCerberusTwoHead) if (actor->GetType() == kDudeCerberusTwoHead)
{ {
if (actor->xspr.health <= 0 && seqGetStatus(actor) < 0) 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) if (actor->spr.type >= kThingBase && actor->spr.type < kThingMax)
{ {
actor->xspr.respawnPending = 3; 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) if (nRespawnTime > 0)
{ {
@ -6569,7 +6569,7 @@ bool actCheckRespawn(DBloodActor* actor)
actPostSprite(actor, kStatRespawn); actPostSprite(actor, kStatRespawn);
actor->spr.flags |= kHitagRespawn; 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.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
actor->spr.pos = actor->basePoint; actor->spr.pos = actor->basePoint;

View file

@ -45,7 +45,7 @@ const int gCultTeslaFireChance[5] = { 0x2000, 0x4000, 0x8000, 0xa000, 0xe000 };
bool dudeIsPlayingSeq(DBloodActor* actor, int nSeq) 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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (seqGetID(actor) == pDudeInfo->seqStartID + nSeq && seqGetStatus(actor) >= 0) 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) 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); 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. auto almost60deg = DAngle::fromBuild(341); // 60° does not work correctly - this is a little bit less, actually.
DAngle v8 = vc.Sgn() == -1 ? -almost60deg : almost60deg; DAngle v8 = vc.Sgn() == -1 ? -almost60deg : almost60deg;
@ -293,7 +293,7 @@ void aiChooseDirection(DBloodActor* actor, DAngle direction)
void aiMoveForward(DBloodActor* actor) 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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -311,7 +311,7 @@ void aiMoveForward(DBloodActor* actor)
void aiMoveTurn(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -326,7 +326,7 @@ void aiMoveTurn(DBloodActor* actor)
void aiMoveDodge(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -350,7 +350,7 @@ void aiMoveDodge(DBloodActor* actor)
void aiActivateDude(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) if (!actor->xspr.state)
{ {
aiChooseDirection(actor, (actor->xspr.TargetPos - actor->spr.pos).Angle()); aiChooseDirection(actor, (actor->xspr.TargetPos - actor->spr.pos).Angle());
@ -388,7 +388,7 @@ void aiActivateDude(DBloodActor* actor)
aiNewState(actor, &cultistSearch); aiNewState(actor, &cultistSearch);
if (Chance(0x8000)) 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); else aiPlay3DSound(actor, 1008 + Random(5), AI_SFX_PRIORITY_1, -1);
} }
break; break;
@ -402,13 +402,13 @@ void aiActivateDude(DBloodActor* actor)
{ {
if (Chance(0x8000)) 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); else aiPlay3DSound(actor, 1003 + Random(4), AI_SFX_PRIORITY_1, -1);
} }
switch (actor->xspr.medium) switch (actor->xspr.medium)
{ {
case kMediumNormal: case kMediumNormal:
if (actor->spr.type == kDudeCultistTommy) aiNewState(actor, &fanaticChase); if (actor->GetType() == kDudeCultistTommy) aiNewState(actor, &fanaticChase);
else aiNewState(actor, &cultistChase); else aiNewState(actor, &cultistChase);
break; break;
case kMediumWater: case kMediumWater:
@ -694,7 +694,7 @@ void aiActivateDude(DBloodActor* actor)
// play gargoyle statue breaking animation if data1 = 1. // play gargoyle statue breaking animation if data1 = 1.
if (gModernMap && actor->xspr.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 aiNewState(actor, &statueSBreakSEQ);
} }
else else
@ -702,14 +702,14 @@ void aiActivateDude(DBloodActor* actor)
if (Chance(0x4000)) aiPlay3DSound(actor, 1401, AI_SFX_PRIORITY_1, -1); if (Chance(0x4000)) aiPlay3DSound(actor, 1401, AI_SFX_PRIORITY_1, -1);
else aiPlay3DSound(actor, 1400, 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 aiNewState(actor, &gargoyleSMorph);
} }
#else #else
if (Chance(0x4000)) aiPlay3DSound(actor, 1401, AI_SFX_PRIORITY_1, -1); if (Chance(0x4000)) aiPlay3DSound(actor, 1401, AI_SFX_PRIORITY_1, -1);
else aiPlay3DSound(actor, 1400, 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 aiNewState(actor, &gargoyleSMorph);
#endif #endif
break; break;
@ -876,7 +876,7 @@ void aiActivateDude(DBloodActor* actor)
aiNewState(actor, &podSearch); aiNewState(actor, &podSearch);
else else
{ {
if (actor->spr.type == kDudePodFire) if (actor->GetType() == kDudePodFire)
aiPlay3DSound(actor, 2453, AI_SFX_PRIORITY_1, -1); aiPlay3DSound(actor, 2453, AI_SFX_PRIORITY_1, -1);
else else
aiPlay3DSound(actor, 2473, AI_SFX_PRIORITY_1, -1); aiPlay3DSound(actor, 2473, AI_SFX_PRIORITY_1, -1);
@ -915,7 +915,7 @@ void aiSetTarget(DBloodActor* actor, DBloodActor* target)
actor->SetTarget(nullptr); actor->SetTarget(nullptr);
return; return;
} }
if (target->spr.type >= kDudeBase && target->spr.type < kDudeMax) if (target->GetType() >= kDudeBase && target->GetType() < kDudeMax)
{ {
if (actor->GetOwner() != target) if (actor->GetOwner() != target)
{ {
@ -993,7 +993,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
return nDamage; return nDamage;
} }
if (actor->spr.type == kDudeModernCustomBurning) if (actor->GetType() == kDudeModernCustomBurning)
{ {
if (Chance(0x2000) && actor->dudeExtra.time < PlayClock) { if (Chance(0x2000) && actor->dudeExtra.time < PlayClock) {
playGenDudeSound(actor,kGenDudeSndBurning); 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; GENDUDEEXTRA* pExtra = &actor->genDudeExtra;
if (nDmgType == kDamageBurn) if (nDmgType == kDamageBurn)
@ -1226,7 +1226,7 @@ void RecoilDude(DBloodActor* actor)
{ {
uint8_t v4 = Chance(0x8000); uint8_t v4 = Chance(0x8000);
DUDEEXTRA* pDudeExtra = &actor->dudeExtra; 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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
switch (actor->spr.type) switch (actor->spr.type)
@ -1289,7 +1289,7 @@ void RecoilDude(DBloodActor* actor)
case kDudeCultistTesla: case kDudeCultistTesla:
case kDudeCultistTNT: case kDudeCultistTNT:
case kDudeCultistBeast: 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); else aiPlay3DSound(actor, 1013 + Random(2), AI_SFX_PRIORITY_2, -1);
if (!v4 && actor->xspr.medium == kMediumNormal) if (!v4 && actor->xspr.medium == kMediumNormal)
@ -1485,7 +1485,7 @@ void RecoilDude(DBloodActor* actor)
void aiThinkTarget(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (Chance(pDudeInfo->alertChance)) if (Chance(pDudeInfo->alertChance))
{ {
@ -1530,7 +1530,7 @@ void aiThinkTarget(DBloodActor* actor)
void aiLookForTarget(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (Chance(pDudeInfo->alertChance)) if (Chance(pDudeInfo->alertChance))
{ {
@ -1572,7 +1572,7 @@ void aiLookForTarget(DBloodActor* actor)
while (DBloodActor* actor2 = it.Next()) while (DBloodActor* actor2 = it.Next())
{ {
double nDist = (actor2->spr.pos.XY() - actor->spr.pos.XY()).Length(); 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); pDudeInfo = getDudeInfo(actor2->spr.type);
if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->HearDist()) if (nDist > pDudeInfo->SeeDist() && nDist > pDudeInfo->HearDist())

View file

@ -66,7 +66,7 @@ void batBiteSeqCallback(int, DBloodActor* actor)
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto pTarget = actor->GetTarget(); 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* pDudeInfo = getDudeInfo(actor->spr.type);
DUDEINFO* pDudeInfoT = getDudeInfo(pTarget->spr.type); DUDEINFO* pDudeInfoT = getDudeInfo(pTarget->spr.type);
@ -77,7 +77,7 @@ void batBiteSeqCallback(int, DBloodActor* actor)
static void batThinkTarget(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats; DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
if (pDudeExtraE->active && pDudeExtraE->thinkTime < 10) if (pDudeExtraE->active && pDudeExtraE->thinkTime < 10)
@ -133,7 +133,7 @@ static void batThinkSearch(DBloodActor* actor)
static void batThinkGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.X; auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.X;
auto nAngle = dvec.Angle(); auto nAngle = dvec.Angle();
@ -151,7 +151,7 @@ static void batThinkPonder(DBloodActor* actor)
aiNewState(actor, &batSearch); aiNewState(actor, &batSearch);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto pTarget = actor->GetTarget(); auto pTarget = actor->GetTarget();
@ -198,7 +198,7 @@ static void batThinkPonder(DBloodActor* actor)
static void batMoveDodgeUp(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -215,7 +215,7 @@ static void batMoveDodgeUp(DBloodActor* actor)
static void batMoveDodgeDown(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -239,7 +239,7 @@ static void batThinkChase(DBloodActor* actor)
aiNewState(actor, &batGoto); aiNewState(actor, &batGoto);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto pTarget = actor->GetTarget(); auto pTarget = actor->GetTarget();
@ -296,7 +296,7 @@ static void batThinkChase(DBloodActor* actor)
static void batMoveForward(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -321,7 +321,7 @@ static void batMoveForward(DBloodActor* actor)
static void batMoveSwoop(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -345,7 +345,7 @@ static void batMoveSwoop(DBloodActor* actor)
static void batMoveFly(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();

View file

@ -101,7 +101,7 @@ void StompSeqCallback(int, DBloodActor* actor)
{ {
if (actor2->hasX()) if (actor2->hasX())
{ {
if (actor2->spr.type == kDudeBeast) if (actor2->GetType() == kDudeBeast)
continue; continue;
if (actor2->spr.flags & 32) if (actor2->spr.flags & 32)
continue; continue;
@ -170,7 +170,7 @@ static void beastThinkSearch(DBloodActor* actor)
static void beastThinkGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto pSector = actor->sector(); auto pSector = actor->sector();
auto pXSector = pSector->hasX() ? &pSector->xs() : nullptr; auto pXSector = pSector->hasX() ? &pSector->xs() : nullptr;
@ -202,7 +202,7 @@ static void beastThinkChase(DBloodActor* actor)
aiNewState(actor, &beastSearch); aiNewState(actor, &beastSearch);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();
@ -322,7 +322,7 @@ static void beastThinkChase(DBloodActor* actor)
static void beastThinkSwimGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
auto nAngle = dvec.Angle(); auto nAngle = dvec.Angle();
@ -340,7 +340,7 @@ static void beastThinkSwimChase(DBloodActor* actor)
aiNewState(actor, &beastSwimGoto); aiNewState(actor, &beastSwimGoto);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();
@ -389,7 +389,7 @@ static void beastThinkSwimChase(DBloodActor* actor)
static void beastMoveForward(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -405,7 +405,7 @@ static void beastMoveForward(DBloodActor* actor)
static void sub_628A0(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -429,7 +429,7 @@ static void sub_628A0(DBloodActor* actor)
static void sub_62AE0(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();
@ -459,7 +459,7 @@ static void sub_62AE0(DBloodActor* actor)
static void sub_62D7C(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();

View file

@ -77,7 +77,7 @@ void eelBiteSeqCallback(int, DBloodActor* actor)
} }
auto target = actor->GetTarget(); 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* pDudeInfo = getDudeInfo(actor->spr.type);
DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type); DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type);
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y); double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
@ -89,7 +89,7 @@ void eelBiteSeqCallback(int, DBloodActor* actor)
static void eelThinkTarget(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats; DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
if (pDudeExtraE->active && pDudeExtraE->thinkTime < 10) if (pDudeExtraE->active && pDudeExtraE->thinkTime < 10)
@ -146,7 +146,7 @@ static void eelThinkSearch(DBloodActor* actor)
static void eelThinkGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
auto nAngle = dvec.Angle(); auto nAngle = dvec.Angle();
@ -164,7 +164,7 @@ static void eelThinkPonder(DBloodActor* actor)
aiNewState(actor, &eelSearch); aiNewState(actor, &eelSearch);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto target = actor->GetTarget(); auto target = actor->GetTarget();
@ -213,7 +213,7 @@ static void eelThinkPonder(DBloodActor* actor)
static void eelMoveDodgeUp(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -230,7 +230,7 @@ static void eelMoveDodgeUp(DBloodActor* actor)
static void eelMoveDodgeDown(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -254,7 +254,7 @@ static void eelThinkChase(DBloodActor* actor)
aiNewState(actor, &eelGoto); aiNewState(actor, &eelGoto);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto target = actor->GetTarget(); auto target = actor->GetTarget();
@ -306,7 +306,7 @@ static void eelThinkChase(DBloodActor* actor)
static void eelMoveForward(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -331,7 +331,7 @@ static void eelMoveForward(DBloodActor* actor)
static void eelMoveSwoop(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -352,7 +352,7 @@ static void eelMoveSwoop(DBloodActor* actor)
static void eelMoveAscend(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();

View file

@ -82,7 +82,7 @@ static void burnThinkSearch(DBloodActor* actor)
static void burnThinkGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
DAngle nAngle = dvec.Angle(); DAngle nAngle = dvec.Angle();
@ -152,7 +152,7 @@ static void burnThinkChase(DBloodActor* actor)
} }
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto target = actor->GetTarget(); auto target = actor->GetTarget();

View file

@ -87,7 +87,7 @@ static void calebThinkSearch(DBloodActor* actor)
static void calebThinkGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto pSector = actor->sector(); auto pSector = actor->sector();
@ -120,7 +120,7 @@ static void calebThinkChase(DBloodActor* actor)
aiNewState(actor, &tinycalebSearch); aiNewState(actor, &tinycalebSearch);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto target = actor->GetTarget(); auto target = actor->GetTarget();
@ -210,7 +210,7 @@ static void calebThinkChase(DBloodActor* actor)
static void calebThinkSwimGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
DAngle nAngle = dvec.Angle(); DAngle nAngle = dvec.Angle();
@ -228,7 +228,7 @@ static void calebThinkSwimChase(DBloodActor* actor)
aiNewState(actor, &tinycalebSwimGoto); aiNewState(actor, &tinycalebSwimGoto);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto target = actor->GetTarget(); auto target = actor->GetTarget();
@ -274,7 +274,7 @@ static void calebThinkSwimChase(DBloodActor* actor)
static void sub_65D04(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -299,7 +299,7 @@ static void sub_65D04(DBloodActor* actor)
static void sub_65F44(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
@ -327,7 +327,7 @@ static void sub_65F44(DBloodActor* actor)
static void sub_661E0(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;

View file

@ -60,8 +60,8 @@ static constexpr double Cerberus_ZOff = 100. / 256;
void cerberusBiteSeqCallback(int, DBloodActor* actor) void cerberusBiteSeqCallback(int, 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; return;
} }
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
@ -215,8 +215,8 @@ static void cerberusThinkSearch(DBloodActor* actor)
static void cerberusThinkTarget(DBloodActor* actor) static void cerberusThinkTarget(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -227,7 +227,7 @@ static void cerberusThinkTarget(DBloodActor* actor)
{ {
actor->xspr.goalAng += DAngle45; actor->xspr.goalAng += DAngle45;
aiSetTarget(actor, actor->basePoint); aiSetTarget(actor, actor->basePoint);
if (actor->spr.type == kDudeCerberusTwoHead) if (actor->GetType() == kDudeCerberusTwoHead)
aiNewState(actor, &cerberus139890); aiNewState(actor, &cerberus139890);
else else
aiNewState(actor, &cerberus1398AC); aiNewState(actor, &cerberus1398AC);
@ -271,8 +271,8 @@ static void cerberusThinkTarget(DBloodActor* actor)
static void cerberusThinkGoto(DBloodActor* actor) static void cerberusThinkGoto(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -308,9 +308,9 @@ static void cerberusThinkChase(DBloodActor* actor)
return; return;
} }
///assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); ///assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
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; return;
} }

View file

@ -124,7 +124,7 @@ void cultThrowSeqCallback(int, DBloodActor* actor)
sfxPlay3DSound(actor, 455, -1, 0); sfxPlay3DSound(actor, 455, -1, 0);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); 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; auto dv = target->spr.pos - actor->spr.pos;
double nDist = dv.XY().Length(); double nDist = dv.XY().Length();
if (nDist > 0x1e0) if (nDist > 0x1e0)
@ -155,7 +155,7 @@ void cultThrowSeqCallback3(int, DBloodActor* actor)
sfxPlay3DSound(actor, 455, -1, 0); sfxPlay3DSound(actor, 455, -1, 0);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); 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; auto dv = target->spr.pos - actor->spr.pos;
double nDist = dv.XY().Length(); double nDist = dv.XY().Length();
@ -168,7 +168,7 @@ static bool TargetNearExplosion(sectortype* sector)
BloodSectIterator it(sector); BloodSectIterator it(sector);
while (auto actor = it.Next()) 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 true;
} }
return false; return false;
@ -182,7 +182,7 @@ static void cultThinkSearch(DBloodActor* actor)
static void cultThinkGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
DAngle nAngle = dvec.Angle(); DAngle nAngle = dvec.Angle();
@ -220,7 +220,7 @@ static void cultThinkChase(DBloodActor* actor)
} }
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto target = actor->GetTarget(); auto target = actor->GetTarget();
@ -235,7 +235,7 @@ static void cultThinkChase(DBloodActor* actor)
{ {
case kMediumNormal: case kMediumNormal:
aiNewState(actor, &cultistSearch); aiNewState(actor, &cultistSearch);
if (actor->spr.type == kDudeCultistTommy) if (actor->GetType() == kDudeCultistTommy)
aiPlay3DSound(actor, 4021 + Random(4), AI_SFX_PRIORITY_1, -1); aiPlay3DSound(actor, 4021 + Random(4), AI_SFX_PRIORITY_1, -1);
else else
aiPlay3DSound(actor, 1021 + Random(4), AI_SFX_PRIORITY_1, -1); aiPlay3DSound(actor, 1021 + Random(4), AI_SFX_PRIORITY_1, -1);

View file

@ -174,8 +174,8 @@ void ThrowSSeqCallback(int, DBloodActor* actor)
static void gargThinkTarget(DBloodActor* actor) static void gargThinkTarget(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -233,8 +233,8 @@ static void gargThinkSearch(DBloodActor* actor)
static void gargThinkGoto(DBloodActor* actor) static void gargThinkGoto(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -249,8 +249,8 @@ static void gargThinkGoto(DBloodActor* actor)
static void gargMoveDodgeUp(DBloodActor* actor) static void gargMoveDodgeUp(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -269,8 +269,8 @@ static void gargMoveDodgeUp(DBloodActor* actor)
static void gargMoveDodgeDown(DBloodActor* actor) static void gargMoveDodgeDown(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -296,9 +296,9 @@ static void gargThinkChase(DBloodActor* actor)
aiNewState(actor, &gargoyleFGoto); aiNewState(actor, &gargoyleFGoto);
return; return;
} }
///assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); ///assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); 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) 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); aiPlay3DSound(actor, 1400, AI_SFX_PRIORITY_1, -1);
else else
aiPlay3DSound(actor, 1450, AI_SFX_PRIORITY_1, -1); aiPlay3DSound(actor, 1450, AI_SFX_PRIORITY_1, -1);
@ -484,8 +484,8 @@ static void entrySStatue(DBloodActor* actor)
static void gargMoveForward(DBloodActor* actor) static void gargMoveForward(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -512,8 +512,8 @@ static void gargMoveForward(DBloodActor* actor)
static void gargMoveSlow(DBloodActor* actor) static void gargMoveSlow(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -547,8 +547,8 @@ static void gargMoveSlow(DBloodActor* actor)
static void gargMoveSwoop(DBloodActor* actor) static void gargMoveSwoop(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -582,8 +582,8 @@ static void gargMoveSwoop(DBloodActor* actor)
static void gargMoveFly(DBloodActor* actor) static void gargMoveFly(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);

View file

@ -155,8 +155,8 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
static void ghostThinkTarget(DBloodActor* actor) static void ghostThinkTarget(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -213,8 +213,8 @@ static void ghostThinkSearch(DBloodActor* actor)
static void ghostThinkGoto(DBloodActor* actor) static void ghostThinkGoto(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -229,8 +229,8 @@ static void ghostThinkGoto(DBloodActor* actor)
static void ghostMoveDodgeUp(DBloodActor* actor) static void ghostMoveDodgeUp(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -249,8 +249,8 @@ static void ghostMoveDodgeUp(DBloodActor* actor)
static void ghostMoveDodgeDown(DBloodActor* actor) static void ghostMoveDodgeDown(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -275,9 +275,9 @@ static void ghostThinkChase(DBloodActor* actor)
aiNewState(actor, &ghostGoto); aiNewState(actor, &ghostGoto);
return; return;
} }
///assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); ///assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -380,8 +380,8 @@ static void ghostThinkChase(DBloodActor* actor)
static void ghostMoveForward(DBloodActor* actor) static void ghostMoveForward(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -407,8 +407,8 @@ static void ghostMoveForward(DBloodActor* actor)
static void ghostMoveSlow(DBloodActor* actor) static void ghostMoveSlow(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -438,8 +438,8 @@ static void ghostMoveSlow(DBloodActor* actor)
static void ghostMoveSwoop(DBloodActor* actor) static void ghostMoveSwoop(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -468,8 +468,8 @@ static void ghostMoveSwoop(DBloodActor* actor)
static void ghostMoveFly(DBloodActor* actor) static void ghostMoveFly(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);

View file

@ -77,7 +77,7 @@ static void gillThinkSearch(DBloodActor* actor)
static void gillThinkGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto pSector = actor->sector(); auto pSector = actor->sector();
@ -110,7 +110,7 @@ static void gillThinkChase(DBloodActor* actor)
aiNewState(actor, &gillBeastSearch); aiNewState(actor, &gillBeastSearch);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();
@ -194,7 +194,7 @@ static void gillThinkChase(DBloodActor* actor)
static void gillThinkSwimGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
DAngle nAngle = dvec.Angle(); DAngle nAngle = dvec.Angle();
@ -212,7 +212,7 @@ static void gillThinkSwimChase(DBloodActor* actor)
aiNewState(actor, &gillBeastSwimSearch); aiNewState(actor, &gillBeastSwimSearch);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();
@ -262,7 +262,7 @@ static void gillThinkSwimChase(DBloodActor* actor)
static void sub_6CB00(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng); auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
auto nTurnRange = pDudeInfo->TurnRange(); auto nTurnRange = pDudeInfo->TurnRange();
@ -287,7 +287,7 @@ static void sub_6CB00(DBloodActor* actor)
static void sub_6CD74(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();
@ -314,7 +314,7 @@ static void sub_6CD74(DBloodActor* actor)
static void sub_6D03C(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();

View file

@ -64,7 +64,7 @@ static void handThinkSearch(DBloodActor* actor)
static void handThinkGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
DAngle nAngle = dvec.Angle(); DAngle nAngle = dvec.Angle();
@ -82,7 +82,7 @@ static void handThinkChase(DBloodActor* actor)
aiNewState(actor, &handGoto); aiNewState(actor, &handGoto);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();

View file

@ -44,8 +44,8 @@ AISTATE houndBurn = { kAiStateChase, 7, nHoundBurnClient, 60, NULL, NULL, NULL,
void houndBiteSeqCallback(int, DBloodActor* actor) void houndBiteSeqCallback(int, 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; return;
} }
@ -69,8 +69,8 @@ static void houndThinkSearch(DBloodActor* actor)
static void houndThinkGoto(DBloodActor* actor) static void houndThinkGoto(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; return;
} }
@ -91,8 +91,8 @@ static void houndThinkChase(DBloodActor* actor)
aiNewState(actor, &houndGoto); aiNewState(actor, &houndGoto);
return; return;
} }
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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);

View file

@ -48,7 +48,7 @@ static void innocThinkSearch(DBloodActor* actor)
static void innocThinkGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
DAngle nAngle = dvec.Angle(); DAngle nAngle = dvec.Angle();
@ -66,7 +66,7 @@ static void innocThinkChase(DBloodActor* actor)
aiNewState(actor, &innocentGoto); aiNewState(actor, &innocentGoto);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();

View file

@ -130,8 +130,8 @@ static void aiPodSearch(DBloodActor* actor)
static void aiPodMove(DBloodActor* actor) static void aiPodMove(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; return;
} }
@ -171,8 +171,8 @@ static void aiPodChase(DBloodActor* actor)
} }
return; return;
} }
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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);

View file

@ -43,7 +43,7 @@ AISTATE ratBite = { kAiStateChase, 6, nRatBiteClient, 120, NULL, NULL, NULL, &ra
void ratBiteSeqCallback(int, DBloodActor* actor) 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; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();
if (target->IsPlayerActor()) if (target->IsPlayerActor())
@ -61,7 +61,7 @@ static void ratThinkSearch(DBloodActor* actor)
static void ratThinkGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
DAngle nAngle = dvec.Angle(); DAngle nAngle = dvec.Angle();
@ -79,7 +79,7 @@ static void ratThinkChase(DBloodActor* actor)
aiNewState(actor, &ratGoto); aiNewState(actor, &ratGoto);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto target = actor->GetTarget(); auto target = actor->GetTarget();

View file

@ -64,7 +64,7 @@ void SpidBiteSeqCallback(int, DBloodActor* actor)
vec.X += Random2F(2000, 14); vec.X += Random2F(2000, 14);
vec.Y += Random2F(2000, 14); vec.Y += Random2F(2000, 14);
vec.Z = 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; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto const target = actor->GetTarget(); auto const target = actor->GetTarget();
@ -113,7 +113,7 @@ void SpidJumpSeqCallback(int, DBloodActor* actor)
vec.Y += Random2F(200, 14); vec.Y += Random2F(200, 14);
vec.Z = 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; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();
if (target->IsPlayerActor()) { if (target->IsPlayerActor()) {
@ -131,7 +131,7 @@ void SpidJumpSeqCallback(int, DBloodActor* actor)
void SpidBirthSeqCallback(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();
@ -169,7 +169,7 @@ static void spidThinkSearch(DBloodActor* actor)
static void spidThinkGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
DAngle nAngle = dvec.Angle(); DAngle nAngle = dvec.Angle();
@ -187,7 +187,7 @@ static void spidThinkChase(DBloodActor* actor)
aiNewState(actor, &spidGoto); aiNewState(actor, &spidGoto);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto target = actor->GetTarget(); auto target = actor->GetTarget();

View file

@ -179,8 +179,8 @@ static void sub_72580(DBloodActor* actor)
static void sub_725A4(DBloodActor* actor) static void sub_725A4(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -234,8 +234,8 @@ static void sub_725A4(DBloodActor* actor)
static void sub_72850(DBloodActor* actor) static void sub_72850(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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
@ -255,8 +255,8 @@ static void tchernobogThinkChase(DBloodActor* actor)
aiNewState(actor, &tcherno13A9B8); aiNewState(actor, &tcherno13A9B8);
return; return;
} }
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; return;
} }
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);

View file

@ -295,7 +295,7 @@ static void ThrowThing(DBloodActor* actor, bool impact)
if (target == nullptr) if (target == nullptr)
return; return;
if (!(target->spr.type >= kDudeBase && target->spr.type < kDudeMax)) if (!(target->GetType() >= kDudeBase && target->GetType() < kDudeMax))
return; return;
int curWeapon = actor->genDudeExtra.curWeapon; int curWeapon = actor->genDudeExtra.curWeapon;
@ -409,9 +409,9 @@ static void unicultThinkSearch(DBloodActor* actor)
static void unicultThinkGoto(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; return;
} }
@ -437,7 +437,7 @@ static void unicultThinkGoto(DBloodActor* actor)
static void unicultThinkChase(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(); auto const target = actor->GetTarget();
if (target == nullptr) if (target == nullptr)
@ -1160,9 +1160,9 @@ void aiGenDudeMoveForward(DBloodActor* actor)
void aiGenDudeChooseDirection(DBloodActor* actor, DAngle direction, const DVector2& vel) 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; return;
} }

View file

@ -88,7 +88,7 @@ static void zombaThinkSearch(DBloodActor* actor)
static void zombaThinkGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
DAngle nAngle = dvec.Angle(); DAngle nAngle = dvec.Angle();
@ -106,7 +106,7 @@ static void zombaThinkChase(DBloodActor* actor)
aiNewState(actor, &zombieASearch); aiNewState(actor, &zombieASearch);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();
@ -127,7 +127,7 @@ static void zombaThinkChase(DBloodActor* actor)
return; 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 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); actor->ChangeType(kDudeZombieAxeNormal);
@ -158,7 +158,7 @@ static void zombaThinkPonder(DBloodActor* actor)
aiNewState(actor, &zombieASearch); aiNewState(actor, &zombieASearch);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();
@ -205,7 +205,7 @@ static void zombaThinkPonder(DBloodActor* actor)
static void myThinkTarget(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
for (int p = connecthead; p >= 0; p = connectpoint2[p]) for (int p = connecthead; p >= 0; p = connectpoint2[p])
{ {

View file

@ -88,7 +88,7 @@ static void zombfThinkSearch(DBloodActor* actor)
static void zombfThinkGoto(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); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
DAngle nAngle = dvec.Angle(); DAngle nAngle = dvec.Angle();
@ -106,7 +106,7 @@ static void zombfThinkChase(DBloodActor* actor)
aiNewState(actor, &zombieFGoto); aiNewState(actor, &zombieFGoto);
return; return;
} }
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (!actor->ValidateTarget(__FUNCTION__)) return; if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget(); auto target = actor->GetTarget();

View file

@ -95,12 +95,12 @@ public:
bool IsPlayerActor() bool IsPlayerActor()
{ {
return spr.type >= kDudePlayer1 && spr.type <= kDudePlayer8; return GetType() >= kDudePlayer1 && GetType() <= kDudePlayer8;
} }
bool IsDudeActor() bool IsDudeActor()
{ {
return spr.type >= kDudeBase && spr.type < kDudeMax; return GetType() >= kDudeBase && GetType() < kDudeMax;
} }
bool IsThingActor() bool IsThingActor()
@ -157,12 +157,11 @@ public:
{ {
spr.type = newtype; spr.type = newtype;
} }
int GetType() const int GetType() const
{ {
return spr.type; return spr.type;
} }
}; };
// subclassed to add a game specific actor() method // subclassed to add a game specific actor() method

View file

@ -314,7 +314,7 @@ void Respawn(DBloodActor* actor, sectortype*) // 9
aiInitSprite(actor); aiInitSprite(actor);
actor->xspr.key = 0; 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_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN;
actor->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE; actor->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE;
} }
@ -650,9 +650,9 @@ void fxPodBloodSplat(DBloodActor* actor, sectortype*) // 19
sfxPlay3DSound(actor, 385, nChannel, 1); sfxPlay3DSound(actor, 385, nChannel, 1);
} }
DBloodActor* pFX = NULL; 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)); pFX = gFX.fxSpawnActor(FX_55, actor->sector(), DVector3(pos, floorZ - 0.25));
if (pFX) if (pFX)
pFX->spr.Angles.Yaw = nAngle; pFX->spr.Angles.Yaw = nAngle;

View file

@ -301,7 +301,7 @@ void fxSpawnPodStuff(DBloodActor* actor, int)
if (adult_lockout && gGameOptions.nGameType <= 0) if (adult_lockout && gGameOptions.nGameType <= 0)
return; return;
DBloodActor* spawnactor; DBloodActor* spawnactor;
if (actor->spr.type == kDudePodGreen) if (actor->GetType() == kDudePodGreen)
spawnactor = gFX.fxSpawnActor(FX_53, actor->sector(), actor->spr.pos); spawnactor = gFX.fxSpawnActor(FX_53, actor->sector(), actor->spr.pos);
else else
spawnactor = gFX.fxSpawnActor(FX_54, actor->sector(), actor->spr.pos); spawnactor = gFX.fxSpawnActor(FX_54, actor->sector(), actor->spr.pos);

View file

@ -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. // 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); arc("gendudeextra", genDudeExtra);
} }

View file

@ -339,7 +339,7 @@ bool nnExtIsImmune(DBloodActor* actor, int dmgType, int minScale)
else if (actor->IsDudeActor()) else if (actor->IsDudeActor())
{ {
if (actor->IsPlayerActor()) return (gPlayer[actor->spr.type - kDudePlayer1].damageControl[dmgType]); 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); 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 // request properties update for custom dude
@ -4403,7 +4403,7 @@ bool condCheckDude(DBloodActor* aCond, int cmpOp, bool PUSH)
auto objActor = eob.actor(); 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()); condError(aCond, "Sprite #%d is dead!", objActor->GetIndex());
if (!objActor->IsDudeActor() || objActor->IsPlayerActor()) if (!objActor->IsDudeActor() || objActor->IsPlayerActor())
@ -4686,7 +4686,7 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH)
default: break; default: break;
case 50: // compare hp (in %) 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; 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; 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); return condCmp((kPercFull * objActor->xspr.health) / ClipLow(var, 1), arg1, arg2, cmpOp);
case 55: // touching ceil of sector? case 55: // touching ceil of sector?
@ -5318,7 +5318,7 @@ bool aiFightUnitCanFly(DBloodActor* dude)
bool aiFightIsMeleeUnit(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); 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); aiSetTarget(actor, actor->spr.pos);
aiSetGenIdleState(actor); aiSetGenIdleState(actor);
if (actor->spr.type == kDudeModernCustom && actLeech) if (actor->GetType() == kDudeModernCustom && actLeech)
removeLeech(actLeech); removeLeech(actLeech);
} }
else if (sourceactor->xspr.data4 == 4) else if (sourceactor->xspr.data4 == 4)
{ {
aiSetTarget(actor, playeractor->spr.pos); aiSetTarget(actor, playeractor->spr.pos);
if (actor->spr.type == kDudeModernCustom && actLeech) if (actor->GetType() == kDudeModernCustom && actLeech)
removeLeech(actLeech); removeLeech(actLeech);
} }
} }
@ -7696,7 +7696,7 @@ bool nnExtCanMove(DBloodActor* actor, DBloodActor* target, DAngle nAngle, double
void nnExtAiSetDirection(DBloodActor* actor, DAngle direction) 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 vc = deltaangle(actor->spr.Angles.Yaw, direction);
DAngle v8 = vc > nullAngle ? DAngle180 / 3 : -DAngle180 / 3; DAngle v8 = vc > nullAngle ? DAngle180 / 3 : -DAngle180 / 3;
@ -7737,7 +7737,7 @@ void nnExtAiSetDirection(DBloodActor* actor, DAngle direction)
void aiPatrolState(DBloodActor* actor, int state) 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()); assert(actor->GetTarget());
auto markeractor = 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; 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... seq = 11537, nSeqOverride = true; // these don't have idle crouch seq for some reason...
if (seq < 0) if (seq < 0)
@ -7804,7 +7804,7 @@ void aiPatrolState(DBloodActor* actor, int state)
if (newState->stateType != state || (!nSeqOverride && seq != newState->seqId)) if (newState->stateType != state || (!nSeqOverride && seq != newState->seqId))
continue; continue;
if (actor->spr.type == kDudeModernCustom) aiGenDudeNewState(actor, newState); if (actor->GetType() == kDudeModernCustom) aiGenDudeNewState(actor, newState);
else aiNewState(actor, newState); else aiNewState(actor, newState);
if (crouch) actor->xspr.unused1 |= kDudeFlagCrouch; if (crouch) actor->xspr.unused1 |= kDudeFlagCrouch;
@ -7852,7 +7852,7 @@ DBloodActor* aiPatrolMarkerBusy(DBloodActor* except, DBloodActor* marker)
bool aiPatrolMarkerReached(DBloodActor* actor) 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]; const DUDEINFO_EXTRA* pExtra = &gDudeInfoExtra[actor->spr.type - kDudeBase];
auto markeractor = actor->GetTarget(); auto markeractor = actor->GetTarget();
@ -8123,7 +8123,7 @@ void aiPatrolMove(DBloodActor* actor)
{ {
auto targetactor = actor->GetTarget(); auto targetactor = actor->GetTarget();
if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax) || !targetactor) if (!(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax) || !targetactor)
return; return;
@ -8342,9 +8342,9 @@ bool spritesTouching(DBloodActor* actor1, DBloodActor* actor2)
bool aiCanCrouch(DBloodActor* actor) 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); 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 actor->genDudeExtra.canDuck;
return false; return false;
@ -8359,7 +8359,7 @@ bool aiCanCrouch(DBloodActor* actor)
bool readyForCrit(DBloodActor* hunter, DBloodActor* victim) 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; return false;
auto dvect = victim->spr.pos.XY() - hunter->spr.pos.XY(); 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. enum { kMaxPatrolFoundSounds = 256 }; // should be the maximum amount of sound channels the engine can play at the same time.
PATROL_FOUND_SOUNDS patrolBonkles[kMaxPatrolFoundSounds]; 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; DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); PLAYER* pPlayer = NULL;
for (int i = 0; i < kMaxPatrolFoundSounds; i++) for (int i = 0; i < kMaxPatrolFoundSounds; i++)
@ -8761,7 +8761,7 @@ bool aiPatrolGetPathDir(DBloodActor* actor, DBloodActor* marker)
void aiPatrolThink(DBloodActor* actor) void aiPatrolThink(DBloodActor* actor)
{ {
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); assert(actor->GetType() >= kDudeBase && actor->GetType() < kDudeMax);
DBloodActor* targetactor; DBloodActor* targetactor;
unsigned int stateTimer; unsigned int stateTimer;
@ -8774,7 +8774,7 @@ void aiPatrolThink(DBloodActor* actor)
bool crouch = (actor->xspr.unused1 & kDudeFlagCrouch), uwater = spriteIsUnderwater(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); aiPatrolStop(actor, nullptr);
return; return;

View file

@ -1011,7 +1011,7 @@ bool findDroppedLeech(PLAYER* a1, DBloodActor* a2)
{ {
if (a2 == actor) if (a2 == actor)
continue; continue;
if (actor->spr.type == kThingDroppedLifeLeech && actor->GetOwner() == a1->actor) if (actor->GetType() == kThingDroppedLifeLeech && actor->GetOwner() == a1->actor)
return 1; return 1;
} }
return 0; return 0;
@ -1435,7 +1435,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out)
out->hitActor = hitactor; out->hitActor = hitactor;
if (hitactor->spr.statnum == kStatThing) if (hitactor->spr.statnum == kStatThing)
{ {
if (hitactor->spr.type == kThingDroppedLifeLeech) if (hitactor->GetType() == kThingDroppedLifeLeech)
{ {
if (gGameOptions.nGameType > 1 && findDroppedLeech(pPlayer, hitactor)) if (gGameOptions.nGameType > 1 && findDroppedLeech(pPlayer, hitactor))
return -1; return -1;

View file

@ -324,7 +324,7 @@ void OperateSprite(DBloodActor* actor, EVENT event)
return; 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) { switch (event.cmd) {
case kCmdOff: case kCmdOff: