hedgewars/uGearsUtils.pas
changeset 10494 0eb97cf4c78e
parent 10419 e19a864e2fab
child 10506 325f7bb60580
equal deleted inserted replaced
10493:bcbf029e6b08 10494:0eb97cf4c78e
   521     isDirH:= false;
   521     isDirH:= false;
   522 
   522 
   523     if WorldEdge = weSea then
   523     if WorldEdge = weSea then
   524         begin
   524         begin
   525         tmp:= dist2Water;
   525         tmp:= dist2Water;
   526         dist2Water:= min(dist2Water, min(X - Gear^.Radius - leftX, rightX - (X + Gear^.Radius)));
   526         dist2Water:= min(dist2Water, min(X - Gear^.Radius - LongInt(leftX), LongInt(rightX) - (X + Gear^.Radius)));
   527         // if water on sides is closer than on bottom -> horizontal direction
   527         // if water on sides is closer than on bottom -> horizontal direction
   528         isDirH:= tmp <> dist2Water;
   528         isDirH:= tmp <> dist2Water;
   529         end;
   529         end;
   530 
   530 
   531     isImpact:= false;
   531     isImpact:= false;