Loading

Paste #pwtccbjkr

  1. function Road::_GetDirectionEfficient(from, to, is_bridge,
  2.         map_size_x = Road._map_size_x)
  3. {
  4.     if (!is_bridge && AITile.GetSlope(to) == AITile.SLOPE_FLAT) return 0xFF;
  5.     local diff = from - to;
  6.     switch (diff) {
  7.         case 1:
  8.             return 1;
  9.         case -1:
  10.             return 2;
  11.         case map_size_x:
  12.             return 4;
  13.         case -map_size_x:
  14.             return 8;
  15.         default:
  16.             assert(false);
  17.     }
  18. }

Comments