Skip to content

Commit

Permalink
Fix freeze when slow moving bullets wall bounce (fixes #686)
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Nov 29, 2020
1 parent 145c3a8 commit 1125055
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cdogs/bullet_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ bool BulletUpdate(struct MobileObject *obj, const int ticks)
posStart = svec2_add(hit.Pos, velNorm);
vel = svec2_scale(velNorm, fullLen - preBounceLen - 1);
}
} while (alive && bounced);
// Don't allow slow moving bullets to bounce forever
} while (alive && bounced && svec2_length_squared(vel) > 2);
if (!alive)
{
return false;
Expand Down

0 comments on commit 1125055

Please sign in to comment.