hedgewars/uCollisions.pas
changeset 10551 4eefc711309e
parent 10494 0eb97cf4c78e
child 10635 8e8b320eefad
--- a/hedgewars/uCollisions.pas	Tue Nov 25 15:20:06 2014 +0100
+++ b/hedgewars/uCollisions.pas	Tue Nov 25 16:46:44 2014 -0500
@@ -75,9 +75,9 @@
     ga: TGearArray;
 
 procedure AddCI(Gear: PGear);
-var t: PGear;
 begin
-if Gear^.CollisionIndex >= 0 then
+if (Gear^.CollisionIndex >= 0) or 
+    ((Count > MAXRECTSINDEX-200) and ((Gear^.Kind = gtMine) or (Gear^.Kind = gtSMine) or (Gear^.Kind = gtKnife))) then
     exit;
 TryDo(Count <= MAXRECTSINDEX, 'Collision rects array overflow', true);
 with cinfos[Count] do
@@ -90,15 +90,6 @@
     end;
 Gear^.CollisionIndex:= Count;
 inc(Count);
-// mines are the easiest way to overflow collision
-if (Count > (MAXRECTSINDEX-20)) then
-    begin
-    t:= GearsList;
-    while (t <> nil) and (t^.Kind <> gtMine) do
-        t:= t^.NextGear;
-    if (t <> nil) then
-        t^.State:= t^.State or gmDelete
-    end;
 end;
 
 procedure DeleteCI(Gear: PGear);