From 84e9017a5f949a8bad10c2b91d9007b40da2f5f3 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 30 Mar 2018 12:49:35 +0300 Subject: [PATCH] Fixed infinite loop with zero height fast projectile https://forum.zdoom.org/viewtopic.php?t=60019 --- wadsrc/static/zscript/shared/fastprojectile.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wadsrc/static/zscript/shared/fastprojectile.txt b/wadsrc/static/zscript/shared/fastprojectile.txt index c861a3f8f..4ba05a7bf 100644 --- a/wadsrc/static/zscript/shared/fastprojectile.txt +++ b/wadsrc/static/zscript/shared/fastprojectile.txt @@ -66,13 +66,21 @@ class FastProjectile : Actor int count = 8; if (radius > 0) { - while ( abs(Vel.X) >= radius * count || abs(Vel.Y) >= radius * count || abs(Vel.Z) >= height * count) + while (abs(Vel.X) >= radius * count || abs(Vel.Y) >= radius * count) { // we need to take smaller steps. count += count; } } + if (height > 0) + { + while (abs(Vel.Z) >= height * count) + { + count += count; + } + } + // Handle movement if (Vel != (0, 0, 0) || (pos.Z != floorz)) {