Fixed infinite loop with zero height fast projectile

https://forum.zdoom.org/viewtopic.php?t=60019
This commit is contained in:
alexey.lysiuk 2018-03-30 12:49:35 +03:00
parent a6738fd139
commit 84e9017a5f

View file

@ -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))
{