From 0c6c78517b3c4bfcb1e5fb8f0c1156944952f144 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 21 Mar 2013 22:23:42 +0000 Subject: [PATCH] - Always at least halve the advance vector in P_CheckMissileSpawn(). SVN r4197 (trunk) --- src/p_mobj.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index bf84d33400..5cc5ecfe1b 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -5277,10 +5277,11 @@ bool P_CheckMissileSpawn (AActor* th, fixed_t maxdist) // Keep halving the advance vector until we get something less than maxdist // units away, since we still want to spawn the missile inside the shooter. - while (TVector2(advance).LengthSquared() >= maxsquared) + do { advance *= 0.5f; } + while (TVector2(advance).LengthSquared() >= maxsquared); th->x += FLOAT2FIXED(advance.X); th->y += FLOAT2FIXED(advance.Y); th->z += FLOAT2FIXED(advance.Z);