From a27e5a0ed247772fcd6f827a82f2cd2eadde092c Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Tue, 11 Oct 2022 16:57:47 +1100 Subject: [PATCH] - SW: Pitch-adjusted velocity for `InitStar()`. --- source/games/sw/src/weapon.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 4d28797f2..350bce61a 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -12987,7 +12987,8 @@ int InitStar(PLAYER* pp) actorNew->spr.shade = -25; actorNew->clipdist = 2; // zvel was overflowing with this calculation - had to move to a local long var - double zvel = pp->horizon.horiz.Tan() * ((HORIZ_MULT + STAR_HORIZ_ADJ) * 0.5); + double zvel = 0; + setFreeAimVelocity(actorNew->vel.X, zvel, pp->horizon.horiz, (HORIZ_MULT + STAR_HORIZ_ADJ) * 0.5); actorNew->user.ceiling_dist = (1); actorNew->user.floor_dist = (1); @@ -13000,6 +13001,7 @@ int InitStar(PLAYER* pp) // MissileSetPos seemed to be pushing the sprite too far up or down when // the horizon was tilted. Never figured out why. actorNew->vel.Z = zvel * 0.5; + double act2zvel = actorNew->vel.Z; if (MissileSetPos(actorNew, DoStar, 1000)) { KillActor(actorNew); @@ -13038,8 +13040,7 @@ int InitStar(PLAYER* pp) if (pp->Flags & (PF_DIVING) || SpriteInUnderwaterArea(actorNew2)) actorNew2->user.Flags |= SPR_UNDERWATER; - zvel = pp->horizon.horiz.Tan() * ((HORIZ_MULT + STAR_HORIZ_ADJ) * 0.5); - actorNew2->vel.Z = zvel * 0.5; + actorNew2->vel.Z = act2zvel; if (MissileSetPos(actorNew2, DoStar, 1000)) {