hedgewars/uCollisions.pas
changeset 11537 bf86c6cb9341
parent 11077 1fb80cd8ba7b
child 11594 c453620cc6d6
--- a/hedgewars/uCollisions.pas	Sun Jan 24 00:02:57 2016 +0100
+++ b/hedgewars/uCollisions.pas	Sun Jan 31 16:07:14 2016 +0300
@@ -62,7 +62,7 @@
 function  CalcSlopeTangent(Gear: PGear; collisionX, collisionY: LongInt; var outDeltaX, outDeltaY: LongInt; TestWord: LongWord): boolean;
 
 implementation
-uses uConsts, uLandGraphics, uVariables, uDebug;
+uses uConsts, uLandGraphics, uVariables;
 
 type TCollisionEntry = record
     X, Y, Radius: LongInt;
@@ -76,10 +76,10 @@
 
 procedure AddCI(Gear: PGear);
 begin
-if (Gear^.CollisionIndex >= 0) or 
+if (Gear^.CollisionIndex >= 0) or (Count > MAXRECTSINDEX) 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
     begin
     X:= hwRound(Gear^.X);