hedgewars/uGearsHandlersMess.pas
changeset 14065 aa586aadd91f
parent 14055 82956b3ba2ab
child 14074 a3506c6a4cbe
equal deleted inserted replaced
14064:12bfae554de5 14065:aa586aadd91f
  2101     if targ <> nil then
  2101     if targ <> nil then
  2102         begin
  2102         begin
  2103         tX:=Gear^.X-targ^.X;
  2103         tX:=Gear^.X-targ^.X;
  2104         tY:=Gear^.Y-targ^.Y;
  2104         tY:=Gear^.Y-targ^.Y;
  2105         // allow escaping - should maybe flag this too
  2105         // allow escaping - should maybe flag this too
  2106         if (GameTicks > Gear^.FlightTime+10000) or 
  2106         if (GameTicks > Gear^.FlightTime + 10000) or
  2107             ((tX.Round+tY.Round > Gear^.Angle*6) and
  2107             (not ((abs(tX.Round) + abs(tY.Round) < Gear^.Angle * 9) and
  2108             (hwRound(hwSqr(tX) + hwSqr(tY)) > sqr(Gear^.Angle*6))) then
  2108                   (hwRound(hwSqr(tX) + hwSqr(tY)) < sqr(Gear^.Angle * 6))))
       
  2109              then
  2109             targ:= nil
  2110             targ:= nil
  2110         end;
  2111         end;
  2111 
  2112 
  2112     // If in ready timer, or after turn, or in first 5 seconds of turn (really a window due to extra time utility)
  2113     // If in ready timer, or after turn, or in first 5 seconds of turn (really a window due to extra time utility)
  2113     // or mine is inactive due to lack of gsttmpflag or hunting is disabled due to seek radius of 0
  2114     // or mine is inactive due to lack of gsttmpflag or hunting is disabled due to seek radius of 0