From e55412f240cfc81c3eadda6ce2f2da01eb368988 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 20 Nov 2022 21:27:51 +1100 Subject: [PATCH] - Remove `DCoreActor::ZeroVelocity()`. --- source/core/coreactor.h | 5 ----- source/games/blood/src/actor.cpp | 8 ++++---- source/games/blood/src/aiunicult.cpp | 2 +- source/games/blood/src/callback.cpp | 6 +++--- source/games/blood/src/nnexts.cpp | 8 ++++---- source/games/blood/src/player.cpp | 2 +- source/games/blood/src/triggers.cpp | 2 +- source/games/exhumed/src/object.cpp | 2 +- 8 files changed, 15 insertions(+), 20 deletions(-) diff --git a/source/core/coreactor.h b/source/core/coreactor.h index 52981f6c7..68e40ea0b 100644 --- a/source/core/coreactor.h +++ b/source/core/coreactor.h @@ -91,11 +91,6 @@ public: spr.angle = spr.angle.Normalized360(); } - void ZeroVelocity() - { - vel = { 0,0,0 }; - } - DVector3 interpolatedpos(double const interpfrac) { return interpolatedvalue(opos, spr.pos, interpfrac); diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 567bad59b..b14b06ec2 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2387,7 +2387,7 @@ static void actInitThings() act->spr.flags = thingInfo[nType].flags; if (act->spr.flags & kPhysGravity) act->spr.flags |= kPhysFalling; - act->ZeroVelocity(); + act->vel.Zero(); switch (act->spr.type) { @@ -2489,7 +2489,7 @@ static void actInitDudes() act->spr.cstat |= CSTAT_SPRITE_BLOOD_BIT1 | CSTAT_SPRITE_BLOCK_ALL; #endif - act->ZeroVelocity(); + act->vel.Zero(); #ifdef NOONE_EXTENSIONS // add a way to set custom hp for every enemy - should work only if map just started and not loaded. @@ -2705,7 +2705,7 @@ static void actNapalmMove(DBloodActor* actor) spawnparam[0] = actor->xspr.data4 >> 1; spawnparam[1] = actor->xspr.data4 - spawnparam[0]; auto ang = actor->spr.angle; - actor->ZeroVelocity(); + actor->vel.Zero(); for (int i = 0; i < 2; i++) { double t1 = RandomD(3.2) + 3.2; @@ -5448,7 +5448,7 @@ void actExplodeSprite(DBloodActor* actor) GibSprite(actor, GIBTYPE_5, nullptr, nullptr); break; } - actor->ZeroVelocity(); + actor->vel.Zero(); actPostSprite(actor, kStatExplosion); actor->spr.scale = DVector2(explodeInfo[nType].repeat * REPEAT_SCALE, explodeInfo[nType].repeat* REPEAT_SCALE); diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index 3c7498156..e165f6051 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -732,7 +732,7 @@ static void unicultThinkChase(DBloodActor* actor) const EXPLOSION* pExpl = &explodeInfo[nType]; if (CheckProximity(actor, target->spr.pos, target->sector(), pExpl->radius >> 1)) { - actor->ZeroVelocity(); + actor->vel.Zero(); if (doExplosion(actor, nType) && actor->xspr.health > 0) actDamageSprite(actor, actor, kDamageExplode, 65535); } diff --git a/source/games/blood/src/callback.cpp b/source/games/blood/src/callback.cpp index 57e060fc2..9080112b4 100644 --- a/source/games/blood/src/callback.cpp +++ b/source/games/blood/src/callback.cpp @@ -274,7 +274,7 @@ void Respawn(DBloodActor* actor, sectortype*) // 9 actor->spr.type = actor->spr.inittype; actor->SetOwner(nullptr); actor->spr.flags &= ~kHitagRespawn; - actor->ZeroVelocity(); + actor->vel.Zero(); actor->xspr.respawnPending = 0; actor->xspr.burnTime = 0; actor->xspr.isTriggered = 0; @@ -542,7 +542,7 @@ void fxBouncingSleeve(DBloodActor* actor, sectortype*) // 16 void sleeveStopBouncing(DBloodActor* actor) { - actor->ZeroVelocity(); + actor->vel.Zero(); if (actor->hasX()) seqKill(actor); sfxKill3DSound(actor, -1, -1); @@ -696,7 +696,7 @@ void sub_76A08(DBloodActor* actor, DBloodActor* actor2, PLAYER* pPlayer) // ??? actor->spr.angle = actor2->spr.angle; ChangeActorSect(actor, actor2->sector()); sfxPlay3DSound(actor2, 201, -1, 0); - actor->ZeroVelocity(); + actor->vel.Zero(); viewBackupSpriteLoc(actor); if (pPlayer) { diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index 0cbadb17b..13ea507a5 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -2613,7 +2613,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe else flags &= ~(kPhysGravity | kPhysFalling); targetactor->spr.flags &= ~(kPhysMove | kPhysGravity | kPhysFalling); - targetactor->ZeroVelocity(); + targetactor->vel.Zero(); targetactor->xspr.restState = targetactor->xspr.state; } @@ -2726,7 +2726,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe { if (oldFlags == 0) - targetactor->ZeroVelocity(); + targetactor->vel.Zero(); if (nIndex != -1) { @@ -2762,7 +2762,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe { targetactor->xspr.physAttr = flags; - targetactor->ZeroVelocity(); + targetactor->vel.Zero(); if (targetactor->spr.lotag >= kThingBase && targetactor->spr.lotag < kThingMax) ChangeActorStat(targetactor, kStatThing); // if it was a thing - restore statnum } @@ -3240,7 +3240,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor) if (sourceactor->xspr.data3 == 1) { - actor->ZeroVelocity(); + actor->vel.Zero(); } else if (sourceactor->xspr.data3 > 0) { diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 4e63ef992..3bb02dd44 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -855,7 +855,7 @@ void playerStart(int nPlayer, int bNewLevel) pPlayer->throwPower = 0; pPlayer->deathTime = 0; pPlayer->nextWeapon = kWeapNone; - actor->ZeroVelocity(); + actor->vel.Zero(); pInput->avel = 0; pInput->actions = 0; pInput->fvel = 0; diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 23b911e8b..28da7efad 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -1620,7 +1620,7 @@ void OperateTeleport(sectortype* pSector) actor->spr.angle = destactor->spr.angle; ChangeActorSect(actor, destactor->sector()); sfxPlay3DSound(destactor, 201, -1, 0); - actor->ZeroVelocity(); + actor->vel.Zero(); actor->interpolated = false; viewBackupSpriteLoc(actor); if (pPlayer) diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 4a3178fc7..378028ed0 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -2148,7 +2148,7 @@ void AIObject::RadialDamage(RunListEvent* ev) if (pActor->spr.statnum == kStatExplodeTarget) { - pActor->ZeroVelocity(); + pActor->vel.Zero(); } else if (pActor->spr.statnum != kStatAnubisDrum) {