From 39d1a758ed0e043b2d46b8f3a52b1e539857fd9d Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 20 Nov 2022 21:27:14 +1100 Subject: [PATCH] - Remove `DCoreActor::ZeroVelocityXY()`. --- source/core/coreactor.h | 5 ----- source/games/blood/src/actor.cpp | 6 +++--- source/games/blood/src/aiunicult.cpp | 2 +- source/games/blood/src/nnexts.cpp | 4 ++-- source/games/duke/src/actors_d.cpp | 2 +- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/source/core/coreactor.h b/source/core/coreactor.h index 36776fd7d..52981f6c7 100644 --- a/source/core/coreactor.h +++ b/source/core/coreactor.h @@ -91,11 +91,6 @@ public: spr.angle = spr.angle.Normalized360(); } - void ZeroVelocityXY() - { - vel .X = vel .Y = 0; - } - void ZeroVelocity() { vel = { 0,0,0 }; diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 9bfd280a6..567bad59b 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2934,7 +2934,7 @@ static bool actKillModernDude(DBloodActor* actor, DAMAGE_TYPE damageType) actDropObject(actor, actor->xspr.dropMsg); actor->spr.flags &= ~kPhysMove; - actor->ZeroVelocityXY(); + actor->vel.XY().Zero(); playGenDudeSound(actor, kGenDudeSndTransforming); int seqId = actor->xspr.data2 + kGenDudeSeqTransform; @@ -5162,7 +5162,7 @@ void MoveDude(DBloodActor* actor) actor->vel.Y += FixedToFloat(-mulscale16r(FloatToFixed(actor->vel.Y), nDrag)); if (actor->vel.XY().Length() < 0.0625) - actor->ZeroVelocityXY(); + actor->vel.XY().Zero(); } } @@ -5949,7 +5949,7 @@ static void actCheckDudes() // handle incarnations of custom dude if (actor->spr.type == kDudeModernCustom && actor->xspr.txID > 0 && actor->xspr.sysData1 == kGenDudeTransformStatus) { - actor->ZeroVelocityXY(); + actor->vel.XY().Zero(); if (seqGetStatus(actor) < 0) genDudeTransform(actor); } #endif diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index 6a69ca7d5..3c7498156 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -217,7 +217,7 @@ void genDudeAttack1(int, DBloodActor* actor) if (actor->GetTarget() == nullptr) return; DVector3 dv; - actor->ZeroVelocityXY(); + actor->vel.XY().Zero(); GENDUDEEXTRA* pExtra = &actor->genDudeExtra; int dispersion = pExtra->baseDispersion; diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 8e2a7e6d3..0cbadb17b 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -1846,7 +1846,7 @@ void debrisMove(int listIndex) actor->vel.XY() *= 1 - nDrag; if (actor->vel.XY().LengthSquared() < 1 / 256.) - actor->ZeroVelocityXY(); + actor->vel.XY().Zero(); } //--------------------------------------------------------------------------- @@ -8154,7 +8154,7 @@ void aiPatrolMove(DBloodActor* actor) if (abs(nAng) > goalAng || ((targetactor->xspr.waitTime > 0 || targetactor->xspr.data1 == targetactor->xspr.data2) && aiPatrolMarkerReached(actor))) { - actor->ZeroVelocityXY(); + actor->vel.XY().Zero(); return; } diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index e5adb2336..5e89dbe5e 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -2056,7 +2056,7 @@ static void flamethrowerflame(DDukeActor *actor) } if (coll.type != 0) { - actor->ZeroVelocityXY(); + actor->vel.XY().Zero(); actor->vel.Z = 0; if (coll.type == kHitSprite) {