Codechange: Pass GRFConfig by reference where feasible. (#13388)
[openttd-github.git] / bin / ai / compat_1.5.nut
blob88f4221b4e6705a9c565973dcbd3447122191c83
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
8 AILog.Info("1.5 API compatibility in effect.");
10 /* 1.9 adds a vehicle type parameter. */
11 AIBridge._GetName <- AIBridge.GetName;
12 AIBridge.GetName <- function(bridge_id)
14 return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
17 /* 1.9 adds parent_group_id to CreateGroup function */
18 AIGroup._CreateGroup <- AIGroup.CreateGroup;
19 AIGroup.CreateGroup <- function(vehicle_type)
21 return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
24 /* 13 really checks RoadType against RoadType */
25 AIRoad._HasRoadType <- AIRoad.HasRoadType;
26 AIRoad.HasRoadType <- function(tile, road_type)
28 local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type));
29 foreach (rt, _ in list) {
30 if (AIRoad._HasRoadType(tile, rt)) {
31 return true;
34 return false;
37 /* 15 renames GetBridgeID */
38 AIBridge.GetBridgeID <- AIBridge.GetBridgeType;