From 865863ab6fb2d8cd464bc6637955eaf11bb41b57 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 2 Oct 2016 14:37:26 +0200 Subject: [PATCH] - fixed: AFastProjectile did not work properly for perfectly vertically moving missiles. Like AActor::Tick it needs to ensure that a tiny bit of lateral movement is present so that collision detection and the Effect() function work as intended. --- src/g_shared/a_fastprojectile.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/g_shared/a_fastprojectile.cpp b/src/g_shared/a_fastprojectile.cpp index c1253f966..ec736bfea 100644 --- a/src/g_shared/a_fastprojectile.cpp +++ b/src/g_shared/a_fastprojectile.cpp @@ -54,6 +54,12 @@ void AFastProjectile::Tick () // Handle movement if (!Vel.isZero() || (Z() != floorz)) { + // force some lateral movement so that collision detection works as intended. + if ((flags & MF_MISSILE) && Vel.X == 0 && Vel.Y == 0 && !IsZeroDamage()) + { + Vel.X = MinVel; + } + frac = Vel / count; changexy = frac.X != 0 || frac.Y != 0; int ripcount = count / 8;