Loading

Paste #piwcihsrz

  1. function WrightAI::SubLocationDistanceAircraft(t0, t1)
  2. {
  3.     local t0x = AIMap.GetTileX(t0);
  4.     local t0y = AIMap.GetTileY(t0);
  5.     local t1x = AIMap.GetTileX(t1);
  6.     local t1y = AIMap.GetTileY(t1);
  7.     local dx = t0x > t1x ? t0x - t1x : t1x - t0x;
  8.     local dy = t0y > t1y ? t0y - t1y : t1y - t0y;
  9.     return dxy = dx > dy ? (dx - dy) * 48 / 4 + dy * 48 / 3 : (dy - dx) * 48 / 4 + dx * 48 / 3;
  10. }

Version history

Revision # Author Created at
p55s04cof Anonymous 27 Aug 2018, 18:24:16 UTC Diff

Comments