# HG changeset patch # User nemo # Date 1416952004 18000 # Node ID 4eefc711309e3ad7ced21c2b1cc81512770fb5d4 # Parent 825991c25319cd074a49c321e02fff1a3a578608 Skip checkin on collision for frequently spammed gear types if collision gets huge instead of trying to delete mines. diff -r 825991c25319 -r 4eefc711309e hedgewars/uCollisions.pas --- 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);