hedgewars/uGearsUtils.pas
changeset 15753 72f735c03fec
parent 15741 8997e212be4c
child 15788 acf70c44065b
equal deleted inserted replaced
15752:f09db263bc2a 15753:72f735c03fec
  1901 Returns true if target has been changed.
  1901 Returns true if target has been changed.
  1902 *)
  1902 *)
  1903 function HomingWrap(var Gear: PGear): boolean;
  1903 function HomingWrap(var Gear: PGear): boolean;
  1904 var dist_center, dist_right, dist_left: hwFloat;
  1904 var dist_center, dist_right, dist_left: hwFloat;
  1905 begin
  1905 begin
       
  1906     HomingWrap:= false;
       
  1907 
  1906     if WorldEdge = weWrap then
  1908     if WorldEdge = weWrap then
  1907         begin
  1909         begin
  1908         HomingWrap:= false;
       
  1909         // We just check the same target 3 times:
  1910         // We just check the same target 3 times:
  1910         // 1) in current section (no change)
  1911         // 1) in current section (no change)
  1911         // 2) clone in the right section
  1912         // 2) clone in the right section
  1912         // 3) clone in the left section
  1913         // 3) clone in the left section
  1913         // The gear will go for the target with the shortest distance to the gear.
  1914         // The gear will go for the target with the shortest distance to the gear.