# HG changeset patch # User Wuzzy # Date 1479929144 -3600 # Node ID 475a1289f9408a36f7d7e820e343d0ccbc3ff86c # Parent 7163626748e0bf720fecb69427368a2fe928b9b7 Fix game extremely slowing down if hog collects crate with huge health, or vampire gets huge health. diff -r 7163626748e0 -r 475a1289f940 hedgewars/uGearsHedgehog.pas --- 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 diff -r 7163626748e0 -r 475a1289f940 hedgewars/uGearsUtils.pas --- 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