Loading

Paste #p1x8xmqgt

  1.         if (this._search_range) {
  2.             local source_x = AIMap.GetTileX(source);
  3.             local source_y = AIMap.GetTileY(source);
  4.             local goal_x = AIMap.GetTileX(goal);
  5.             local goal_y = AIMap.GetTileY(goal);
  6.  
  7.             local min_freeform = AIMap.IsValidTile(0) ? 0 : 1;
  8.             local max_freeform = min_freeform == 0 ? 3 : 2;
  9.  
  10.             this._min_x = max(min_freeform, min(source_x, goal_x) - this._search_range);
  11.             this._min_y = max(min_freeform, min(source_y, goal_y) - this._search_range);
  12.             this._max_x = min(AIMap.GetMapSizeX() - max_freeform, max(source_x, goal_x) + this._search_range);
  13.             this._max_y = max(AIMap.GetMapSizeY() - max_freeform, max(source_y, goal_y) + this._search_range);
  14.         }

Version history

Revision # Author Created at
prqsbwaty Anonymous 18 Aug 2019, 21:11:07 UTC Diff
pmfujrgil Anonymous 18 Aug 2019, 20:58:18 UTC Diff

Comments