From 5c6cac49c85e4ec755e41d6f0bfd681a00b221cf Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 25 Sep 2022 19:32:14 +0200 Subject: [PATCH] - changed a few vel setter calls. --- source/games/blood/src/ai.cpp | 3 +-- source/games/blood/src/aibeast.cpp | 3 +-- source/games/blood/src/dude.h | 10 +++++----- source/games/blood/src/fx.cpp | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/source/games/blood/src/ai.cpp b/source/games/blood/src/ai.cpp index 008cd70e9..948ec6124 100644 --- a/source/games/blood/src/ai.cpp +++ b/source/games/blood/src/ai.cpp @@ -304,8 +304,7 @@ void aiMoveForward(DBloodActor* actor) actor->spr.angle += clamp(nAng, -nTurnRange, nTurnRange); if (abs(nAng) > DAngle60) return; - actor->add_int_bvel_x(MulScale(pDudeInfo->frontSpeed, Cos(actor->int_ang()), 30)); - actor->add_int_bvel_y(MulScale(pDudeInfo->frontSpeed, Sin(actor->int_ang()), 30)); + actor->vel.XY() += actor->spr.angle.ToVector() * pDudeInfo->FrontSpeed(); } //--------------------------------------------------------------------------- diff --git a/source/games/blood/src/aibeast.cpp b/source/games/blood/src/aibeast.cpp index 442f7220f..650068901 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -402,8 +402,7 @@ static void beastMoveForward(DBloodActor* actor) int nDist = approxDist(dvec); if (nDist <= 0x400 && Random(64) < 32) return; - actor->add_int_bvel_x(MulScale(pDudeInfo->frontSpeed, Cos(actor->int_ang()), 30)); - actor->add_int_bvel_y(MulScale(pDudeInfo->frontSpeed, Sin(actor->int_ang()), 30)); + actor->vel.XY() += actor->spr.angle.ToVector() * pDudeInfo->FrontSpeed(); } static void sub_628A0(DBloodActor* actor) diff --git a/source/games/blood/src/dude.h b/source/games/blood/src/dude.h index 50b62d1f0..dc4a63d81 100644 --- a/source/games/blood/src/dude.h +++ b/source/games/blood/src/dude.h @@ -64,15 +64,15 @@ struct DUDEINFO { return seeDist * maptoworld; } - inline double EyeHeight() const - { - return eyeHeight * maptoworld; - } - inline DAngle Periphery() const { return mapangle(periphery); } + + inline double FrontSpeed() const + { + return FixedToFloat(frontSpeed); + } }; extern DUDEINFO dudeInfo[kDudeMax - kDudeBase]; diff --git a/source/games/blood/src/fx.cpp b/source/games/blood/src/fx.cpp index 3cd9ca4d9..ee7142dd3 100644 --- a/source/games/blood/src/fx.cpp +++ b/source/games/blood/src/fx.cpp @@ -265,7 +265,7 @@ void CFX::fxProcess(void) continue; } } - actor->add_int_bvel_z(pFXData->gravity); + actor->vel.Z += FixedToFloat(pFXData->gravity); } }