Fix game extremely slowing down if hog collects crate with huge health, or vampire gets huge health.
--- a/hedgewars/uGearsHedgehog.pas Wed Nov 23 19:43:40 2016 +0100
+++ b/hedgewars/uGearsHedgehog.pas Wed Nov 23 20:25:44 2016 +0100
@@ -748,7 +748,7 @@
RecountTeamHealth(HH^.Hedgehog^.Team);
i:= 0;
- while i < Gear^.Health do
+ while (i < Gear^.Health) and (i <= 1000) do
begin
vga:= AddVisualGear(hwRound(HH^.X), hwRound(HH^.Y), vgtStraightShot);
if vga <> nil then
--- a/hedgewars/uGearsUtils.pas Wed Nov 23 19:43:40 2016 +0100
+++ b/hedgewars/uGearsUtils.pas Wed Nov 23 20:25:44 2016 +0100
@@ -282,7 +282,7 @@
RenderHealth(CurrentHedgehog^);
RecountTeamHealth(CurrentHedgehog^.Team);
i:= 0;
- while i < vampDmg do
+ while (i < vampDmg) and (i < 1000) do
begin
vg:= AddVisualGear(hwRound(CurrentHedgehog^.Gear^.X), hwRound(CurrentHedgehog^.Gear^.Y), vgtStraightShot);
if vg <> nil then