# HG changeset patch # User unc0rr # Date 1126033779 0 # Node ID 366adfa1a727eb5fc51f5065dccdfc4b72a8883d # Parent b64d67d222b9e3e902fd12c69f823ff544c6654b Fix reading out of bounds of the collisions array. This fixes flying hedgehogs and not moving after explosion diff -r b64d67d222b9 -r 366adfa1a727 hedgewars/uCollisions.pas --- a/hedgewars/uCollisions.pas Sun Sep 04 21:19:19 2005 +0000 +++ b/hedgewars/uCollisions.pas Tue Sep 06 19:09:39 2005 +0000 @@ -100,6 +100,8 @@ var x1, x2, y1, y2: integer; i: Longword; begin +Result:= false; +if Count = 0 then exit; x1:= round(Gear.X); y1:= round(Gear.Y); {if (Gear.State and gstOutOfHH) = 0 then @@ -111,7 +113,6 @@ or (y1 - Gear.HalfHeight > round(p.Y) + p.HalfHeight) or (y1 + Gear.HalfHeight < round(p.Y) - p.HalfHeight)) then Gear.State:= Gear.State or gstOutOfHH; end; } -Result:= false; if forX then begin x1:= x1 + Dir*Gear.HalfWidth;