From 7ed45d713aa3f3693f800aa6beed2ef8409d66be Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 4 Oct 2022 19:15:15 +0200 Subject: [PATCH] - refactor all oclipdist uses --- source/games/sw/src/jweapon.cpp | 10 ++++------ source/games/sw/src/weapon.cpp | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index 702947392..655b281a9 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -1251,7 +1251,6 @@ int DoRadiationCloud(DSWActor* actor) int PlayerInitChemBomb(PLAYER* pp) { DSWActor* plActor = pp->actor; - short oclipdist; PlaySound(DIGI_THROW, pp, v3df_dontpan | v3df_doppler); @@ -1291,13 +1290,13 @@ int PlayerInitChemBomb(PLAYER* pp) actorNew->vel.Z += pp->horizon.horiz.Tan() * HORIZ_MULTF; - oclipdist = plActor->native_clipdist(); + double oclipdist = plActor->clipdist; plActor->clipdist = 0; actorNew->clipdist = 0; MissileSetPos(actorNew, DoChemBomb, 1000); - plActor->set_native_clipdist(oclipdist); + plActor->clipdist = oclipdist; actorNew->clipdist = 5; UpdateChange(actorNew, 0.5); @@ -1631,7 +1630,6 @@ void SpawnFlashBombOnActor(DSWActor* actor) int PlayerInitCaltrops(PLAYER* pp) { DSWActor* plActor = pp->actor; - short oclipdist; PlaySound(DIGI_THROW, pp, v3df_dontpan | v3df_doppler); @@ -1666,13 +1664,13 @@ int PlayerInitCaltrops(PLAYER* pp) actorNew->vel.Z += pp->horizon.horiz.Tan() * HORIZ_MULTF; - oclipdist = plActor->native_clipdist(); + double oclipdist = plActor->clipdist; plActor->clipdist = 0; actorNew->clipdist = 0; MissileSetPos(actorNew, DoCaltrops, 1000); - plActor->set_native_clipdist(oclipdist); + plActor->clipdist = oclipdist; actorNew->clipdist = 5; UpdateChange(actorNew, 0.5); diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 33206823d..24e468685 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -12069,7 +12069,7 @@ void InitSpellNapalm(PLAYER* pp) actor->user.ceiling_dist = (1); actor->user.Dist = 12.5; - auto oclipdist = plActor->native_clipdist(); + auto oclipdist = plActor->clipdist; plActor->clipdist = 0.25; if (mp[i].dist_over != 0) @@ -12083,7 +12083,7 @@ void InitSpellNapalm(PLAYER* pp) if (MissileSetPos(actor, DoNapalm, mp[i].dist_out)) { - plActor->set_native_clipdist(oclipdist); + plActor->clipdist = oclipdist; KillActor(actor); continue; } @@ -12091,7 +12091,7 @@ void InitSpellNapalm(PLAYER* pp) if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actor)) actor->user.Flags |= (SPR_UNDERWATER); - plActor->set_native_clipdist(oclipdist); + plActor->clipdist = oclipdist; actor->user.Counter = 0; @@ -12201,13 +12201,13 @@ int InitSpellMirv(PLAYER* pp) actorNew->user.Dist = 12.5; DSWActor* plActor = pp->actor; - auto oclipdist = plActor->native_clipdist(); + auto oclipdist = plActor->clipdist; plActor->clipdist = 0; UpdateChange(actorNew); MissileSetPos(actorNew, DoMirv, 600); - plActor->set_native_clipdist(oclipdist); + plActor->clipdist = oclipdist; actorNew->user.Counter = 0; return 0; @@ -13176,14 +13176,14 @@ void InitHeartAttack(PLAYER* pp) actorNew->user.ceiling_dist = (1); actorNew->user.Dist = 12.5; - auto oclipdist = plActor->native_clipdist(); + auto oclipdist = plActor->clipdist; plActor->clipdist = 0.25; UpdateChange(actorNew); MissileSetPos(actorNew, DoBloodWorm, mp[i].dist_out); - plActor->set_native_clipdist(oclipdist); + plActor->clipdist = oclipdist; actorNew->user.Counter = 0; actorNew->user.Counter2 = 0; actorNew->user.Counter3 = 0; @@ -15341,7 +15341,7 @@ int InitTracerUzi(PLAYER* pp) actorNew->spr.cstat |= (CSTAT_SPRITE_INVISIBLE); DSWActor* plActor = pp->actor; - auto oclipdist = plActor->native_clipdist(); + auto oclipdist = plActor->clipdist; plActor->clipdist = 0; actorNew->spr.angle += DAngle90; @@ -15353,14 +15353,14 @@ int InitTracerUzi(PLAYER* pp) if (MissileSetPos(actorNew, DoTracerStart, 800)) { - plActor->set_native_clipdist(oclipdist); + plActor->clipdist = oclipdist; KillActor(actorNew); return 0; } actorNew->vel.Z = pp->horizon.horiz.Tan() * actorNew->vel.X; - plActor->set_native_clipdist(oclipdist); + plActor->clipdist = oclipdist; WeaponAutoAim(pp->actor, actorNew, DAngle22_5 / 4, false);