diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 9e7ea0d7c..ea32dcbe6 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -3965,7 +3965,7 @@ static void actImpactMissile(DBloodActor* missileActor, int hitCode) missileActor->spr.picnum = 2123; missileActor->SetTarget(actorHit); missileActor->xspr.TargetPos.Z = (missileActor->spr.pos.Z - actorHit->spr.pos.Z); - missileActor->xspr.goalAng = getangle(missileActor->spr.pos.XY() - actorHit->spr.pos.XY()) - actorHit->int_ang(); + missileActor->xspr._goalAng = getangle(missileActor->spr.pos.XY() - actorHit->spr.pos.XY()) - actorHit->int_ang(); missileActor->xspr.state = 1; actPostSprite(missileActor, kStatFlare); missileActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; @@ -6139,8 +6139,8 @@ void actCheckFlares() if (target->hasX() && target->xspr.health > 0) { DVector3 pos = target->spr.pos; - pos.X += mulscale30r(Cos(actor->xspr.goalAng + target->int_ang()), target->spr.clipdist * 2) * inttoworld; - pos.Y += mulscale30r(Sin(actor->xspr.goalAng + target->int_ang()), target->spr.clipdist * 2) * inttoworld; + pos.X += mulscale30r(Cos(actor->xspr._goalAng + target->int_ang()), target->spr.clipdist * 2) * inttoworld; + pos.Y += mulscale30r(Sin(actor->xspr._goalAng + target->int_ang()), target->spr.clipdist * 2) * inttoworld; pos.Z += actor->xspr.TargetPos.Z; SetActor(actor, pos); actor->vel = target->vel; diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index febacab11..43bd24a4b 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -261,21 +261,21 @@ void aiChooseDirection(DBloodActor* actor, int a3) if (vc < 0) v8 = -341; if (CanMove(actor, actor->GetTarget(), actor->int_ang() + vc, vsi)) - actor->xspr.goalAng = actor->int_ang() + vc; + actor->xspr._goalAng = actor->int_ang() + vc; else if (CanMove(actor, actor->GetTarget(), actor->int_ang() + vc / 2, vsi)) - actor->xspr.goalAng = actor->int_ang() + vc / 2; + actor->xspr._goalAng = actor->int_ang() + vc / 2; else if (CanMove(actor, actor->GetTarget(), actor->int_ang() - vc / 2, vsi)) - actor->xspr.goalAng = actor->int_ang() - vc / 2; + actor->xspr._goalAng = actor->int_ang() - vc / 2; else if (CanMove(actor, actor->GetTarget(), actor->int_ang() + v8, vsi)) - actor->xspr.goalAng = actor->int_ang() + v8; + actor->xspr._goalAng = actor->int_ang() + v8; else if (CanMove(actor, actor->GetTarget(), actor->int_ang(), vsi)) - actor->xspr.goalAng = actor->int_ang(); + actor->xspr._goalAng = actor->int_ang(); else if (CanMove(actor, actor->GetTarget(), actor->int_ang() - v8, vsi)) - actor->xspr.goalAng = actor->int_ang() - v8; + actor->xspr._goalAng = actor->int_ang() - v8; //else if (actor->spr.flags&2) //actor->xspr.goalAng = actor->spr.angle+341; else // Weird.. - actor->xspr.goalAng = actor->int_ang() + 341; + actor->xspr._goalAng = actor->int_ang() + 341; if (Chance(0x8000)) actor->xspr.dodgeDir = 1; else @@ -298,7 +298,7 @@ void aiMoveForward(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); if (abs(nAng) > DAngle60) @@ -317,7 +317,7 @@ void aiMoveTurn(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); } @@ -332,7 +332,7 @@ void aiMoveDodge(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); if (actor->xspr.dodgeDir) diff --git a/source/games/blood/src/aibat.cpp b/source/games/blood/src/aibat.cpp index 5783529fb..f716f114c 100644 --- a/source/games/blood/src/aibat.cpp +++ b/source/games/blood/src/aibat.cpp @@ -85,7 +85,7 @@ static void batThinkTarget(DBloodActor* actor) else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active) { pDudeExtraE->thinkTime = 0; - actor->xspr.goalAng += 256; + actor->xspr._goalAng += 256; aiSetTarget(actor, actor->basePoint); aiNewState(actor, &batTurn); return; @@ -127,7 +127,7 @@ static void batThinkTarget(DBloodActor* actor) static void batThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); batThinkTarget(actor); } @@ -200,7 +200,7 @@ static void batMoveDodgeUp(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); AdjustVelocity(actor, ADJUSTER{ @@ -217,7 +217,7 @@ static void batMoveDodgeDown(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); if (actor->xspr.dodgeDir == 0) @@ -295,7 +295,7 @@ static void batMoveForward(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; @@ -320,13 +320,13 @@ static void batMoveSwoop(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; if (abs(nAng) > DAngle60) { - actor->xspr.goalAng = (actor->int_ang() + 512) & 2047; + actor->xspr._goalAng = (actor->int_ang() + 512) & 2047; return; } auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.X; @@ -344,7 +344,7 @@ static void batMoveFly(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; diff --git a/source/games/blood/src/aibeast.cpp b/source/games/blood/src/aibeast.cpp index 3902f1c06..b15bc5402 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -163,7 +163,7 @@ static void MorphToBeast(DBloodActor* actor) static void beastThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiThinkTarget(actor); } @@ -393,7 +393,7 @@ static void beastMoveForward(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); if (abs(nAng) > DAngle60) @@ -410,7 +410,7 @@ static void sub_628A0(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; @@ -438,13 +438,13 @@ static void sub_62AE0(DBloodActor* actor) auto target = actor->GetTarget(); int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight; int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight; - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; if (abs(nAng) > DAngle60) { - actor->xspr.goalAng = (actor->int_ang() + 512) & 2047; + actor->xspr._goalAng = (actor->int_ang() + 512) & 2047; return; } auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); @@ -467,7 +467,7 @@ static void sub_62D7C(DBloodActor* actor) auto target = actor->GetTarget(); int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight; int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight; - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; diff --git a/source/games/blood/src/aiboneel.cpp b/source/games/blood/src/aiboneel.cpp index 4c3a8cf5e..ba2ee5dde 100644 --- a/source/games/blood/src/aiboneel.cpp +++ b/source/games/blood/src/aiboneel.cpp @@ -97,7 +97,7 @@ static void eelThinkTarget(DBloodActor* actor) else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active) { pDudeExtraE->thinkTime = 0; - actor->xspr.goalAng += 256; + actor->xspr._goalAng += 256; aiSetTarget(actor, actor->basePoint); aiNewState(actor, &eelTurn); return; @@ -140,7 +140,7 @@ static void eelThinkTarget(DBloodActor* actor) static void eelThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); eelThinkTarget(actor); } @@ -215,7 +215,7 @@ static void eelMoveDodgeUp(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); AdjustVelocity(actor, ADJUSTER{ @@ -232,7 +232,7 @@ static void eelMoveDodgeDown(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); if (actor->xspr.dodgeDir == 0) @@ -307,7 +307,7 @@ static void eelMoveForward(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2; @@ -332,7 +332,7 @@ static void eelMoveSwoop(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2; @@ -353,7 +353,7 @@ static void eelMoveAscend(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 26) / 120) / 120) << 2; diff --git a/source/games/blood/src/aiburn.cpp b/source/games/blood/src/aiburn.cpp index 7a5737d57..c1929fb55 100644 --- a/source/games/blood/src/aiburn.cpp +++ b/source/games/blood/src/aiburn.cpp @@ -76,7 +76,7 @@ void BurnSeqCallback(int, DBloodActor*) static void burnThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiThinkTarget(actor); } diff --git a/source/games/blood/src/aicaleb.cpp b/source/games/blood/src/aicaleb.cpp index 5c2535e1d..5c2e4dd2d 100644 --- a/source/games/blood/src/aicaleb.cpp +++ b/source/games/blood/src/aicaleb.cpp @@ -82,7 +82,7 @@ void SeqAttackCallback(int, DBloodActor* actor) static void calebThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiThinkTarget(actor); } @@ -278,7 +278,7 @@ static void sub_65D04(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; @@ -308,13 +308,13 @@ static void sub_65F44(DBloodActor* actor) auto target = actor->GetTarget(); int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight; int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight; - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; if (abs(nAng) > DAngle60) { - actor->xspr.goalAng = (actor->int_ang() + 512) & 2047; + actor->xspr._goalAng = (actor->int_ang() + 512) & 2047; return; } auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); @@ -338,7 +338,7 @@ static void sub_661E0(DBloodActor* actor) auto target = actor->GetTarget(); int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight; int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight; - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; diff --git a/source/games/blood/src/aicerber.cpp b/source/games/blood/src/aicerber.cpp index 7aeae1103..786dec8d6 100644 --- a/source/games/blood/src/aicerber.cpp +++ b/source/games/blood/src/aicerber.cpp @@ -227,7 +227,7 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor) static void cerberusThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiThinkTarget(actor); } @@ -243,7 +243,7 @@ static void cerberusThinkTarget(DBloodActor* actor) pDudeExtraE->thinkTime++; else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active) { - actor->xspr.goalAng += 256; + actor->xspr._goalAng += 256; aiSetTarget(actor, actor->basePoint); if (actor->spr.type == kDudeCerberusTwoHead) aiNewState(actor, &cerberus139890); diff --git a/source/games/blood/src/aicult.cpp b/source/games/blood/src/aicult.cpp index e7e4b6649..b5b0ca257 100644 --- a/source/games/blood/src/aicult.cpp +++ b/source/games/blood/src/aicult.cpp @@ -186,7 +186,7 @@ static bool TargetNearExplosion(sectortype* sector) static void cultThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiLookForTarget(actor); } diff --git a/source/games/blood/src/aigarg.cpp b/source/games/blood/src/aigarg.cpp index 5e35dc817..4069c7ee0 100644 --- a/source/games/blood/src/aigarg.cpp +++ b/source/games/blood/src/aigarg.cpp @@ -206,7 +206,7 @@ static void gargThinkTarget(DBloodActor* actor) pDudeExtraE->thinkTime++; else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active) { - actor->xspr.goalAng += 256; + actor->xspr._goalAng += 256; aiSetTarget(actor, actor->basePoint); aiNewState(actor, &gargoyleTurn); return; @@ -249,7 +249,7 @@ static void gargThinkTarget(DBloodActor* actor) static void gargThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiLookForTarget(actor); } @@ -276,7 +276,7 @@ static void gargMoveDodgeUp(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); AdjustVelocity(actor, ADJUSTER{ @@ -296,7 +296,7 @@ static void gargMoveDodgeDown(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); if (actor->xspr.dodgeDir == 0) @@ -508,7 +508,7 @@ static void gargMoveForward(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; @@ -536,13 +536,13 @@ static void gargMoveSlow(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; if (abs(nAng) > DAngle60) { - actor->xspr.goalAng = (actor->int_ang() + 512) & 2047; + actor->xspr._goalAng = (actor->int_ang() + 512) & 2047; return; } auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); @@ -571,13 +571,13 @@ static void gargMoveSwoop(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; if (abs(nAng) > DAngle60) { - actor->xspr.goalAng = (actor->int_ang() + 512) & 2047; + actor->xspr._goalAng = (actor->int_ang() + 512) & 2047; return; } auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); @@ -606,7 +606,7 @@ static void gargMoveFly(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; diff --git a/source/games/blood/src/aighost.cpp b/source/games/blood/src/aighost.cpp index e103f54b9..f44153e14 100644 --- a/source/games/blood/src/aighost.cpp +++ b/source/games/blood/src/aighost.cpp @@ -186,7 +186,7 @@ static void ghostThinkTarget(DBloodActor* actor) pDudeExtraE->thinkTime++; else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active) { - actor->xspr.goalAng += 256; + actor->xspr._goalAng += 256; aiSetTarget(actor, actor->basePoint); aiNewState(actor, &ghostTurn); return; @@ -228,7 +228,7 @@ static void ghostThinkTarget(DBloodActor* actor) static void ghostThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiThinkTarget(actor); } @@ -255,7 +255,7 @@ static void ghostMoveDodgeUp(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); AdjustVelocity(actor, ADJUSTER{ @@ -275,7 +275,7 @@ static void ghostMoveDodgeDown(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); if (actor->xspr.dodgeDir == 0) @@ -403,7 +403,7 @@ static void ghostMoveForward(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; @@ -430,13 +430,13 @@ static void ghostMoveSlow(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; if (abs(nAng) > DAngle60) { - actor->xspr.goalAng = (actor->int_ang() + 512) & 2047; + actor->xspr._goalAng = (actor->int_ang() + 512) & 2047; return; } auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); @@ -461,13 +461,13 @@ static void ghostMoveSwoop(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; if (abs(nAng) > DAngle60) { - actor->xspr.goalAng = (actor->int_ang() + 512) & 2047; + actor->xspr._goalAng = (actor->int_ang() + 512) & 2047; return; } auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); @@ -491,7 +491,7 @@ static void ghostMoveFly(DBloodActor* actor) return; } DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; diff --git a/source/games/blood/src/aigilbst.cpp b/source/games/blood/src/aigilbst.cpp index bc07a0fc0..7a63ccd1d 100644 --- a/source/games/blood/src/aigilbst.cpp +++ b/source/games/blood/src/aigilbst.cpp @@ -73,7 +73,7 @@ void GillBiteSeqCallback(int, DBloodActor* actor) static void gillThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiThinkTarget(actor); } @@ -265,7 +265,7 @@ static void sub_6CB00(DBloodActor* actor) { assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax); DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2; @@ -294,13 +294,13 @@ static void sub_6CD74(DBloodActor* actor) auto target = actor->GetTarget(); int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight; int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight; - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2; if (abs(nAng) > DAngle60) { - actor->xspr.goalAng = (actor->int_ang() + 512) & 2047; + actor->xspr._goalAng = (actor->int_ang() + 512) & 2047; return; } auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY(); @@ -323,7 +323,7 @@ static void sub_6D03C(DBloodActor* actor) auto target = actor->GetTarget(); int z = actor->int_pos().Z + getDudeInfo(actor->spr.type)->eyeHeight; int z2 = target->int_pos().Z + getDudeInfo(target->spr.type)->eyeHeight; - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = (pDudeInfo->frontSpeed - (((4 - gGameOptions.nDifficulty) << 27) / 120) / 120) << 2; diff --git a/source/games/blood/src/aihand.cpp b/source/games/blood/src/aihand.cpp index 402824aaa..b13a68cfa 100644 --- a/source/games/blood/src/aihand.cpp +++ b/source/games/blood/src/aihand.cpp @@ -58,7 +58,7 @@ void HandJumpSeqCallback(int, DBloodActor* actor) static void handThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiThinkTarget(actor); } diff --git a/source/games/blood/src/aihound.cpp b/source/games/blood/src/aihound.cpp index dd040a3c6..fc85628cd 100644 --- a/source/games/blood/src/aihound.cpp +++ b/source/games/blood/src/aihound.cpp @@ -69,7 +69,7 @@ void houndBurnSeqCallback(int, DBloodActor* actor) static void houndThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiThinkTarget(actor); } diff --git a/source/games/blood/src/aiinnoc.cpp b/source/games/blood/src/aiinnoc.cpp index 6605f80b7..5104e2584 100644 --- a/source/games/blood/src/aiinnoc.cpp +++ b/source/games/blood/src/aiinnoc.cpp @@ -42,7 +42,7 @@ AISTATE innocentGoto = { kAiStateMove, 6, -1, 600, NULL, aiMoveForward, innocThi static void innocThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiThinkTarget(actor); } diff --git a/source/games/blood/src/aipod.cpp b/source/games/blood/src/aipod.cpp index 6e6b17367..2faf5e9c0 100644 --- a/source/games/blood/src/aipod.cpp +++ b/source/games/blood/src/aipod.cpp @@ -127,7 +127,7 @@ void sub_70284(int, DBloodActor* actor) static void aiPodSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiThinkTarget(actor); } diff --git a/source/games/blood/src/airat.cpp b/source/games/blood/src/airat.cpp index ee293d778..4845d0118 100644 --- a/source/games/blood/src/airat.cpp +++ b/source/games/blood/src/airat.cpp @@ -54,7 +54,7 @@ void ratBiteSeqCallback(int, DBloodActor* actor) static void ratThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiThinkTarget(actor); } diff --git a/source/games/blood/src/aispid.cpp b/source/games/blood/src/aispid.cpp index a38d3f728..679610088 100644 --- a/source/games/blood/src/aispid.cpp +++ b/source/games/blood/src/aispid.cpp @@ -162,7 +162,7 @@ void SpidBirthSeqCallback(int, DBloodActor* actor) static void spidThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiThinkTarget(actor); } diff --git a/source/games/blood/src/aitchern.cpp b/source/games/blood/src/aitchern.cpp index 53515d818..db4a88573 100644 --- a/source/games/blood/src/aitchern.cpp +++ b/source/games/blood/src/aitchern.cpp @@ -197,7 +197,7 @@ void sub_720AC(int, DBloodActor* actor) static void sub_72580(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiThinkTarget(actor); } @@ -213,7 +213,7 @@ static void sub_725A4(DBloodActor* actor) pDudeExtraE->thinkTime++; else if (pDudeExtraE->thinkTime >= 10 && pDudeExtraE->active) { - actor->xspr.goalAng += 256; + actor->xspr._goalAng += 256; aiSetTarget(actor, actor->basePoint); aiNewState(actor, &tcherno13AA28); return; diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index 0c960a0a8..f978ceaa2 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -401,7 +401,7 @@ static void unicultThinkSearch(DBloodActor* actor) { // TO DO: if can't see the target, but in fireDist range - stop moving and look around - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiLookForTarget(actor); } @@ -899,7 +899,7 @@ static void unicultThinkChase(DBloodActor* actor) { if (spriteIsUnderwater(actor)) aiGenDudeNewState(actor, &genDudeChaseW); else aiGenDudeNewState(actor, &genDudeChaseL); - actor->xspr.goalAng = Random(kAng360); + actor->xspr._goalAng = Random(kAng360); //viewSetSystemMessage("WALL OR SPRITE TOUCH"); } @@ -1114,7 +1114,7 @@ void aiGenDudeMoveForward(DBloodActor* actor) if (pExtra->canFly) { - auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr.goalAng)); + auto nAng = deltaangle(actor->spr.angle, DAngle::fromBuild(actor->xspr._goalAng)); auto nTurnRange = DAngle::fromQ16(pDudeInfo->angSpeed << 3); actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); int nAccel = pDudeInfo->frontSpeed << 2; @@ -1136,7 +1136,7 @@ void aiGenDudeMoveForward(DBloodActor* actor) } else { - int dang = ((kAng180 + actor->xspr.goalAng - actor->int_ang()) & 2047) - kAng180; + int dang = ((kAng180 + actor->xspr._goalAng - actor->int_ang()) & 2047) - kAng180; actor->set_int_ang(((actor->int_ang() + ClipRange(dang, -maxTurn, maxTurn)) & 2047)); // don't move forward if trying to turn around @@ -1173,19 +1173,19 @@ void aiGenDudeChooseDirection(DBloodActor* actor, int a3, int xvel, int yvel) int vsi = ((t1 * 15) >> 12) / 2; int v8 = (vc >= 0) ? 341 : -341; if (CanMove(actor, actor->GetTarget(), actor->int_ang() + vc, vsi)) - actor->xspr.goalAng = actor->int_ang() + vc; + actor->xspr._goalAng = actor->int_ang() + vc; else if (CanMove(actor, actor->GetTarget(), actor->int_ang() + vc / 2, vsi)) - actor->xspr.goalAng = actor->int_ang() + vc / 2; + actor->xspr._goalAng = actor->int_ang() + vc / 2; else if (CanMove(actor, actor->GetTarget(), actor->int_ang() - vc / 2, vsi)) - actor->xspr.goalAng = actor->int_ang() - vc / 2; + actor->xspr._goalAng = actor->int_ang() - vc / 2; else if (CanMove(actor, actor->GetTarget(), actor->int_ang() + v8, vsi)) - actor->xspr.goalAng = actor->int_ang() + v8; + actor->xspr._goalAng = actor->int_ang() + v8; else if (CanMove(actor, actor->GetTarget(), actor->int_ang(), vsi)) - actor->xspr.goalAng = actor->int_ang(); + actor->xspr._goalAng = actor->int_ang(); else if (CanMove(actor, actor->GetTarget(), actor->int_ang() - v8, vsi)) - actor->xspr.goalAng = actor->int_ang() - v8; + actor->xspr._goalAng = actor->int_ang() - v8; else - actor->xspr.goalAng = actor->int_ang() + 341; + actor->xspr._goalAng = actor->int_ang() + 341; actor->xspr.dodgeDir = (Chance(0x8000)) ? 1 : -1; diff --git a/source/games/blood/src/aizomba.cpp b/source/games/blood/src/aizomba.cpp index 46dd1731b..b9fbd8656 100644 --- a/source/games/blood/src/aizomba.cpp +++ b/source/games/blood/src/aizomba.cpp @@ -83,7 +83,7 @@ void StandSeqCallback(int, DBloodActor* actor) static void zombaThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiLookForTarget(actor); } @@ -248,7 +248,7 @@ static void myThinkTarget(DBloodActor* actor) static void myThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); myThinkTarget(actor); } diff --git a/source/games/blood/src/aizombf.cpp b/source/games/blood/src/aizombf.cpp index 4ee30b6ca..de83430ba 100644 --- a/source/games/blood/src/aizombf.cpp +++ b/source/games/blood/src/aizombf.cpp @@ -82,7 +82,7 @@ void ThrowSeqCallback(int, DBloodActor* actor) static void zombfThinkSearch(DBloodActor* actor) { - aiChooseDirection(actor, actor->xspr.goalAng); + aiChooseDirection(actor, actor->xspr._goalAng); aiThinkTarget(actor); } diff --git a/source/games/blood/src/db.cpp b/source/games/blood/src/db.cpp index 3be7b7486..0556e5b9b 100644 --- a/source/games/blood/src/db.cpp +++ b/source/games/blood/src/db.cpp @@ -549,7 +549,7 @@ void dbLoadMap(const char* pPath, DVector3& pos, short* pAngle, int* cursectnum, pXSprite->data1 = bitReader.readSigned(16); pXSprite->data2 = bitReader.readSigned(16); pXSprite->data3 = bitReader.readSigned(16); - pXSprite->goalAng = bitReader.readUnsigned(11); + pXSprite->_goalAng = bitReader.readUnsigned(11); pXSprite->dodgeDir = bitReader.readSigned(2); pXSprite->locked = bitReader.readUnsigned(1); pXSprite->medium = bitReader.readUnsigned(2); diff --git a/source/games/blood/src/loadsave.cpp b/source/games/blood/src/loadsave.cpp index 29dc5367e..99021ee8a 100644 --- a/source/games/blood/src/loadsave.cpp +++ b/source/games/blood/src/loadsave.cpp @@ -634,7 +634,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, XSPRITE& w, XSPRIT ("burnsource", w.burnSource, def->burnSource) ("busytime", w.busyTime, def->busyTime) ("waittime", w.waitTime, def->waitTime) - ("goalang", w.goalAng, def->goalAng) + ("goalang", w._goalAng, def->_goalAng) ("burntime", w.burnTime, def->burnTime) ("height", w.height, def->height) ("statetimer", w.stateTimer, def->stateTimer) diff --git a/source/games/blood/src/mapstructs.h b/source/games/blood/src/mapstructs.h index dd88d2b30..1cc7e657b 100644 --- a/source/games/blood/src/mapstructs.h +++ b/source/games/blood/src/mapstructs.h @@ -104,6 +104,7 @@ struct XSPRITE { const vec3_t int_TargetPos() const { return { int(TargetPos.X * worldtoint), int(TargetPos.Y * worldtoint), int(TargetPos.Z * worldtoint)}; } DVector3 TargetPos; + uint16_t _goalAng; // Dude goal ang int32_t sysData1; // used to keep here various system data, so user can't change it in map editor int32_t sysData2; // @@ -121,7 +122,6 @@ struct XSPRITE { uint16_t busyTime; // busyTime uint16_t waitTime; // waitTime uint16_t data4; // Data 4 - uint16_t goalAng; // Dude goal ang uint16_t burnTime; uint16_t height; uint16_t stateTimer; // ai timer diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 4ad790c6f..017137dff 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -1347,23 +1347,23 @@ void nnExtProcessSuperSprites() debrisMove(i); if (debrisactor->vel.X != 0 || debrisactor->int_vel().Y) - debrisactor->xspr.goalAng = getangle(debrisactor->vel) & 2047; + debrisactor->xspr._goalAng = getangle(debrisactor->vel) & 2047; int ang = debrisactor->int_ang() & 2047; if ((uwater = spriteIsUnderwater(debrisactor)) == false) evKillActor(debrisactor, kCallbackEnemeyBubble); else if (Chance(0x1000 - mass)) { if (debrisactor->vel.Z > 0x100) debrisBubble(debrisactor); - if (ang == debrisactor->xspr.goalAng) + if (ang == debrisactor->xspr._goalAng) { - debrisactor->xspr.goalAng = (debrisactor->int_ang() + Random3(kAng60)) & 2047; + debrisactor->xspr._goalAng = (debrisactor->int_ang() + Random3(kAng60)) & 2047; debrisBubble(debrisactor); } } int angStep = ClipLow(mulscale8(1, ((abs(debrisactor->int_vel().X) + abs(debrisactor->int_vel().Y)) >> 5)), (uwater) ? 1 : 0); - if (ang < debrisactor->xspr.goalAng) debrisactor->set_int_ang(ClipHigh(ang + angStep, debrisactor->xspr.goalAng)); - else if (ang > debrisactor->xspr.goalAng) debrisactor->set_int_ang(ClipLow(ang - angStep, debrisactor->xspr.goalAng)); + if (ang < debrisactor->xspr._goalAng) debrisactor->set_int_ang(ClipHigh(ang + angStep, debrisactor->xspr._goalAng)); + else if (ang > debrisactor->xspr._goalAng) debrisactor->set_int_ang(ClipLow(ang - angStep, debrisactor->xspr._goalAng)); auto pSector = debrisactor->sector(); int cz = getceilzofslopeptr(pSector, debrisactor->int_pos().X, debrisactor->int_pos().Y); @@ -2784,7 +2784,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe // set random goal ang for swimming so they start turning if ((flags & kPhysDebrisSwim) && targetactor->int_vel().X ==0 && targetactor->vel.Y == 0 && targetactor->vel.Z == 0) - targetactor->xspr.goalAng = (targetactor->int_ang() + Random3(kAng45)) & 2047; + targetactor->xspr._goalAng = (targetactor->int_ang() + Random3(kAng45)) & 2047; if (targetactor->xspr.physAttr & kPhysDebrisVector) targetactor->spr.cstat |= CSTAT_SPRITE_BLOCK_HITSCAN; @@ -7738,19 +7738,19 @@ void nnExtAiSetDirection(DBloodActor* actor, int a3) v8 = -341; if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() + vc, vsi)) - actor->xspr.goalAng = actor->int_ang() + vc; + actor->xspr._goalAng = actor->int_ang() + vc; else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() + vc / 2, vsi)) - actor->xspr.goalAng = actor->int_ang() + vc / 2; + actor->xspr._goalAng = actor->int_ang() + vc / 2; else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() - vc / 2, vsi)) - actor->xspr.goalAng = actor->int_ang() - vc / 2; + actor->xspr._goalAng = actor->int_ang() - vc / 2; else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() + v8, vsi)) - actor->xspr.goalAng = actor->int_ang() + v8; + actor->xspr._goalAng = actor->int_ang() + v8; else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang(), vsi)) - actor->xspr.goalAng = actor->int_ang(); + actor->xspr._goalAng = actor->int_ang(); else if (nnExtCanMove(actor, actor->GetTarget(), actor->int_ang() - v8, vsi)) - actor->xspr.goalAng = actor->int_ang() - v8; + actor->xspr._goalAng = actor->int_ang() - v8; else - actor->xspr.goalAng = actor->int_ang() + 341; + actor->xspr._goalAng = actor->int_ang() + 341; if (actor->xspr.dodgeDir) { @@ -8132,7 +8132,7 @@ void aiPatrolRandGoalAng(DBloodActor* actor) if (Chance(0x8000)) goal = -goal; - actor->xspr.goalAng = (actor->int_ang() + goal) & 2047; + actor->xspr._goalAng = (actor->int_ang() + goal) & 2047; } //--------------------------------------------------------------------------- @@ -8144,7 +8144,7 @@ void aiPatrolRandGoalAng(DBloodActor* actor) void aiPatrolTurn(DBloodActor* actor) { int nTurnRange = (getDudeInfo(actor->spr.type)->angSpeed << 1) >> 4; - int nAng = getincangle(actor->int_ang(), actor->xspr.goalAng); + int nAng = getincangle(actor->int_ang(), actor->xspr._goalAng); actor->set_int_ang((actor->int_ang() + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047); } @@ -8192,7 +8192,7 @@ void aiPatrolMove(DBloodActor* actor) } int nTurnRange = (pDudeInfo->angSpeed << 2) >> 4; - int nAng = getincangle(actor->int_ang(), actor->xspr.goalAng); + int nAng = getincangle(actor->int_ang(), actor->xspr._goalAng); actor->set_int_ang((actor->int_ang() + ClipRange(nAng, -nTurnRange, nTurnRange)) & 2047); if (abs(nAng) > goalAng || ((targetactor->xspr.waitTime > 0 || targetactor->xspr.data1 == targetactor->xspr.data2) && aiPatrolMarkerReached(actor))) @@ -8873,7 +8873,7 @@ void aiPatrolThink(DBloodActor* actor) else if (aiPatrolTurning(actor->xspr.aiState)) { //viewSetSystemMessage("TURN"); - if ((int)actor->int_ang() == (int)actor->xspr.goalAng) + if ((int)actor->int_ang() == (int)actor->xspr._goalAng) { // save imer for waiting stateTimer = actor->xspr.stateTimer; @@ -8904,8 +8904,8 @@ void aiPatrolThink(DBloodActor* actor) // take marker's angle if (!(markeractor->spr.flags & kModernTypeFlag4)) { - actor->xspr.goalAng = ((!(markeractor->spr.flags & kModernTypeFlag8) && actor->xspr.unused2) ? markeractor->int_ang() + kAng180 : markeractor->int_ang()) & 2047; - if ((int)actor->int_ang() != (int)actor->xspr.goalAng) // let the enemy play move animation while turning + actor->xspr._goalAng = ((!(markeractor->spr.flags & kModernTypeFlag8) && actor->xspr.unused2) ? markeractor->int_ang() + kAng180 : markeractor->int_ang()) & 2047; + if ((int)actor->int_ang() != (int)actor->xspr._goalAng) // let the enemy play move animation while turning return; } @@ -9331,7 +9331,7 @@ void changeSpriteAngle(DBloodActor* pSpr, int nAng) { pSpr->set_int_ang(nAng); if (pSpr->hasX()) - pSpr->xspr.goalAng = pSpr->int_ang(); + pSpr->xspr._goalAng = pSpr->int_ang(); } } }