mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-12-01 08:31:14 +00:00
Fixed infinite loop with zero height fast projectile
https://forum.zdoom.org/viewtopic.php?t=60019
This commit is contained in:
parent
a6738fd139
commit
84e9017a5f
1 changed files with 9 additions and 1 deletions
|
@ -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))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue