hedgewars/uGearsUtils.pas
changeset 12450 28bf941e13a0
parent 12347 ad09d733fdb0
child 12451 48ee3777e42e
equal deleted inserted replaced
12449:832b969ea00c 12450:28bf941e13a0
   879                 begin
   879                 begin
   880                 repeat
   880                 repeat
   881                     inc(y, 2);
   881                     inc(y, 2);
   882                 until (y >= cWaterLine) or
   882                 until (y >= cWaterLine) or
   883                         ((not ignoreOverlap) and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FFFF) = 0)) or
   883                         ((not ignoreOverlap) and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FFFF) = 0)) or
   884                         (ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, lfLandMask) = 0));
   884                         (ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, lfLandMask and (not lfIce)) = 0));
   885 
   885 
   886                 sy:= y;
   886                 sy:= y;
   887 
   887 
   888                 repeat
   888                 repeat
   889                     inc(y);
   889                     inc(y);
   890                 until (y >= cWaterLine) or
   890                 until (y >= cWaterLine) or
   891                         ((not ignoreOverlap) and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FFFF) <> 0)) or
   891                         ((not ignoreOverlap) and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, $FFFF) <> 0)) or
   892                         (ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, lfLandMask) <> 0));
   892                         (ignoreOverlap and (CountNonZeroz(x, y, Gear^.Radius - 1, 1, lfLandMask and (not lfIce)) <> 0));
   893 
   893 
   894                 if (y - sy > Gear^.Radius * 2) and (y < cWaterLine)
   894                 if (y - sy > Gear^.Radius * 2) and (y < cWaterLine)
   895                     and (((Gear^.Kind = gtExplosives)
   895                     and (((Gear^.Kind = gtExplosives)
   896                         and (ignoreNearObjects or NoGearsToAvoid(x, y - Gear^.Radius, 60, 60))
   896                         and (ignoreNearObjects or NoGearsToAvoid(x, y - Gear^.Radius, 60, 60))
   897                         and (isSteadyPosition(x, y+1, Gear^.Radius - 1, 3, $FFFF)
   897                         and (isSteadyPosition(x, y+1, Gear^.Radius - 1, 3, $FFFF)