diff --git a/bin/ai/compat_0.7.nut b/bin/ai/compat_0.7.nut index 0b2fa1f243..258ab17c75 100644 --- a/bin/ai/compat_0.7.nut +++ b/bin/ai/compat_0.7.nut @@ -5,7 +5,6 @@ * 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 . */ -AILog.Info("0.7 API compatibility in effect:"); AILog.Info(" - AITown::GetLastMonthProduction's behaviour has slightly changed."); AILog.Info(" - AISubsidy::GetDestination returns STATION_INVALID for awarded subsidies."); AILog.Info(" - AISubsidy::GetSource returns STATION_INVALID for awarded subsidies."); @@ -257,141 +256,4 @@ class AIWaypointList extends _AIWaypointList { } } -AIRoad._BuildRoadStation <- AIRoad.BuildRoadStation; -AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id) -{ - if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false; - - return AIRoad._BuildRoadStation(tile, front, road_veh_type, station_id); -} - -AIRoad._BuildDriveThroughRoadStation <- AIRoad.BuildDriveThroughRoadStation; -AIRoad.BuildDriveThroughRoadStation <- function(tile, front, road_veh_type, station_id) -{ - if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false; - - return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id); -} - -AIBridgeList.HasNext <- -AIBridgeList_Length.HasNext <- -AICargoList.HasNext <- -AICargoList_IndustryAccepting.HasNext <- -AICargoList_IndustryProducing.HasNext <- -AIDepotList.HasNext <- -AIEngineList.HasNext <- -AIGroupList.HasNext <- -AIIndustryList.HasNext <- -AIIndustryList_CargoAccepting.HasNext <- -AIIndustryList_CargoProducing.HasNext <- -AIIndustryTypeList.HasNext <- -AIList.HasNext <- -AIRailTypeList.HasNext <- -AISignList.HasNext <- -AIStationList.HasNext <- -AIStationList_Vehicle.HasNext <- -AISubsidyList.HasNext <- -AITileList.HasNext <- -AITileList_IndustryAccepting.HasNext <- -AITileList_IndustryProducing.HasNext <- -AITileList_StationType.HasNext <- -AITownList.HasNext <- -AIVehicleList.HasNext <- -AIVehicleList_DefaultGroup.HasNext <- -AIVehicleList_Group.HasNext <- -AIVehicleList_SharedOrders.HasNext <- -AIVehicleList_Station.HasNext <- -AIWaypointList.HasNext <- -AIWaypointList_Vehicle.HasNext <- -function() -{ - return !this.IsEnd(); -} - -AIIndustry._IsCargoAccepted <- AIIndustry.IsCargoAccepted; -AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id) -{ - return AIIndustry._IsCargoAccepted(industry_id, cargo_id) != AIIndustry.CAS_NOT_ACCEPTED; -} - -AIAbstractList <- AIList; - -AIList.ChangeItem <- AIList.SetValue; - -AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF; - -AICompany.GetCompanyValue <- function(company) -{ - return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER); -} - -AITown.GetLastMonthTransported <- AITown.GetLastMonthSupplied; - -AIEvent.AI_ET_INVALID <- AIEvent.ET_INVALID; -AIEvent.AI_ET_TEST <- AIEvent.ET_TEST; -AIEvent.AI_ET_SUBSIDY_OFFER <- AIEvent.ET_SUBSIDY_OFFER; -AIEvent.AI_ET_SUBSIDY_OFFER_EXPIRED <- AIEvent.ET_SUBSIDY_OFFER_EXPIRED; -AIEvent.AI_ET_SUBSIDY_AWARDED <- AIEvent.ET_SUBSIDY_AWARDED; -AIEvent.AI_ET_SUBSIDY_EXPIRED <- AIEvent.ET_SUBSIDY_EXPIRED; -AIEvent.AI_ET_ENGINE_PREVIEW <- AIEvent.ET_ENGINE_PREVIEW; -AIEvent.AI_ET_COMPANY_NEW <- AIEvent.ET_COMPANY_NEW; -AIEvent.AI_ET_COMPANY_IN_TROUBLE <- AIEvent.ET_COMPANY_IN_TROUBLE; -AIEvent.AI_ET_COMPANY_MERGER <- AIEvent.ET_COMPANY_MERGER; -AIEvent.AI_ET_COMPANY_BANKRUPT <- AIEvent.ET_COMPANY_BANKRUPT; -AIEvent.AI_ET_VEHICLE_CRASHED <- AIEvent.ET_VEHICLE_CRASHED; -AIEvent.AI_ET_VEHICLE_LOST <- AIEvent.ET_VEHICLE_LOST; -AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT <- AIEvent.ET_VEHICLE_WAITING_IN_DEPOT; -AIEvent.AI_ET_VEHICLE_UNPROFITABLE <- AIEvent.ET_VEHICLE_UNPROFITABLE; -AIEvent.AI_ET_INDUSTRY_OPEN <- AIEvent.ET_INDUSTRY_OPEN; -AIEvent.AI_ET_INDUSTRY_CLOSE <- AIEvent.ET_INDUSTRY_CLOSE; -AIEvent.AI_ET_ENGINE_AVAILABLE <- AIEvent.ET_ENGINE_AVAILABLE; -AIEvent.AI_ET_STATION_FIRST_VEHICLE <- AIEvent.ET_STATION_FIRST_VEHICLE; -AIEvent.AI_ET_DISASTER_ZEPPELINER_CRASHED <- AIEvent.ET_DISASTER_ZEPPELINER_CRASHED; -AIEvent.AI_ET_DISASTER_ZEPPELINER_CLEARED <- AIEvent.ET_DISASTER_ZEPPELINER_CLEARED; -AIOrder.AIOF_NONE <- AIOrder.OF_NONE -AIOrder.AIOF_NON_STOP_INTERMEDIATE <- AIOrder.OF_NON_STOP_INTERMEDIATE -AIOrder.AIOF_NON_STOP_DESTINATION <- AIOrder.OF_NON_STOP_DESTINATION -AIOrder.AIOF_UNLOAD <- AIOrder.OF_UNLOAD -AIOrder.AIOF_TRANSFER <- AIOrder.OF_TRANSFER -AIOrder.AIOF_NO_UNLOAD <- AIOrder.OF_NO_UNLOAD -AIOrder.AIOF_FULL_LOAD <- AIOrder.OF_FULL_LOAD -AIOrder.AIOF_FULL_LOAD_ANY <- AIOrder.OF_FULL_LOAD_ANY -AIOrder.AIOF_NO_LOAD <- AIOrder.OF_NO_LOAD -AIOrder.AIOF_SERVICE_IF_NEEDED <- AIOrder.OF_SERVICE_IF_NEEDED -AIOrder.AIOF_STOP_IN_DEPOT <- AIOrder.OF_STOP_IN_DEPOT -AIOrder.AIOF_GOTO_NEAREST_DEPOT <- AIOrder.OF_GOTO_NEAREST_DEPOT -AIOrder.AIOF_NON_STOP_FLAGS <- AIOrder.OF_NON_STOP_FLAGS -AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS -AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS -AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS -AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID - -/* 1.9 adds a vehicle type parameter. */ -AIBridge._GetName <- AIBridge.GetName; -AIBridge.GetName <- function(bridge_id) -{ - return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL); -} - -/* 1.9 adds parent_group_id to CreateGroup function */ -AIGroup._CreateGroup <- AIGroup.CreateGroup; -AIGroup.CreateGroup <- function(vehicle_type) -{ - return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -AIRoad._HasRoadType <- AIRoad.HasRoadType; -AIRoad.HasRoadType <- function(tile, road_type) -{ - local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (AIRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_1.0.nut") diff --git a/bin/ai/compat_1.0.nut b/bin/ai/compat_1.0.nut index bf3b8334e6..eaf79359f9 100644 --- a/bin/ai/compat_1.0.nut +++ b/bin/ai/compat_1.0.nut @@ -5,8 +5,6 @@ * 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 . */ -AILog.Info("1.0 API compatibility in effect."); - AIRoad._BuildRoadStation <- AIRoad.BuildRoadStation; AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id) { @@ -71,79 +69,4 @@ AIList.ChangeItem <- AIList.SetValue; AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF; -AICompany.GetCompanyValue <- function(company) -{ - return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER); -} - -AITown.GetLastMonthTransported <- AITown.GetLastMonthSupplied; - -AIEvent.AI_ET_INVALID <- AIEvent.ET_INVALID; -AIEvent.AI_ET_TEST <- AIEvent.ET_TEST; -AIEvent.AI_ET_SUBSIDY_OFFER <- AIEvent.ET_SUBSIDY_OFFER; -AIEvent.AI_ET_SUBSIDY_OFFER_EXPIRED <- AIEvent.ET_SUBSIDY_OFFER_EXPIRED; -AIEvent.AI_ET_SUBSIDY_AWARDED <- AIEvent.ET_SUBSIDY_AWARDED; -AIEvent.AI_ET_SUBSIDY_EXPIRED <- AIEvent.ET_SUBSIDY_EXPIRED; -AIEvent.AI_ET_ENGINE_PREVIEW <- AIEvent.ET_ENGINE_PREVIEW; -AIEvent.AI_ET_COMPANY_NEW <- AIEvent.ET_COMPANY_NEW; -AIEvent.AI_ET_COMPANY_IN_TROUBLE <- AIEvent.ET_COMPANY_IN_TROUBLE; -AIEvent.AI_ET_COMPANY_ASK_MERGER <- AIEvent.ET_COMPANY_ASK_MERGER; -AIEvent.AI_ET_COMPANY_MERGER <- AIEvent.ET_COMPANY_MERGER; -AIEvent.AI_ET_COMPANY_BANKRUPT <- AIEvent.ET_COMPANY_BANKRUPT; -AIEvent.AI_ET_VEHICLE_CRASHED <- AIEvent.ET_VEHICLE_CRASHED; -AIEvent.AI_ET_VEHICLE_LOST <- AIEvent.ET_VEHICLE_LOST; -AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT <- AIEvent.ET_VEHICLE_WAITING_IN_DEPOT; -AIEvent.AI_ET_VEHICLE_UNPROFITABLE <- AIEvent.ET_VEHICLE_UNPROFITABLE; -AIEvent.AI_ET_INDUSTRY_OPEN <- AIEvent.ET_INDUSTRY_OPEN; -AIEvent.AI_ET_INDUSTRY_CLOSE <- AIEvent.ET_INDUSTRY_CLOSE; -AIEvent.AI_ET_ENGINE_AVAILABLE <- AIEvent.ET_ENGINE_AVAILABLE; -AIEvent.AI_ET_STATION_FIRST_VEHICLE <- AIEvent.ET_STATION_FIRST_VEHICLE; -AIEvent.AI_ET_DISASTER_ZEPPELINER_CRASHED <- AIEvent.ET_DISASTER_ZEPPELINER_CRASHED; -AIEvent.AI_ET_DISASTER_ZEPPELINER_CLEARED <- AIEvent.ET_DISASTER_ZEPPELINER_CLEARED; -AIOrder.AIOF_NONE <- AIOrder.OF_NONE -AIOrder.AIOF_NON_STOP_INTERMEDIATE <- AIOrder.OF_NON_STOP_INTERMEDIATE -AIOrder.AIOF_NON_STOP_DESTINATION <- AIOrder.OF_NON_STOP_DESTINATION -AIOrder.AIOF_UNLOAD <- AIOrder.OF_UNLOAD -AIOrder.AIOF_TRANSFER <- AIOrder.OF_TRANSFER -AIOrder.AIOF_NO_UNLOAD <- AIOrder.OF_NO_UNLOAD -AIOrder.AIOF_FULL_LOAD <- AIOrder.OF_FULL_LOAD -AIOrder.AIOF_FULL_LOAD_ANY <- AIOrder.OF_FULL_LOAD_ANY -AIOrder.AIOF_NO_LOAD <- AIOrder.OF_NO_LOAD -AIOrder.AIOF_SERVICE_IF_NEEDED <- AIOrder.OF_SERVICE_IF_NEEDED -AIOrder.AIOF_STOP_IN_DEPOT <- AIOrder.OF_STOP_IN_DEPOT -AIOrder.AIOF_GOTO_NEAREST_DEPOT <- AIOrder.OF_GOTO_NEAREST_DEPOT -AIOrder.AIOF_NON_STOP_FLAGS <- AIOrder.OF_NON_STOP_FLAGS -AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS -AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS -AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS -AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID - -/* 1.9 adds a vehicle type parameter. */ -AIBridge._GetName <- AIBridge.GetName; -AIBridge.GetName <- function(bridge_id) -{ - return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL); -} - -/* 1.9 adds parent_group_id to CreateGroup function */ -AIGroup._CreateGroup <- AIGroup.CreateGroup; -AIGroup.CreateGroup <- function(vehicle_type) -{ - return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -AIRoad._HasRoadType <- AIRoad.HasRoadType; -AIRoad.HasRoadType <- function(tile, road_type) -{ - local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (AIRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_1.1.nut") diff --git a/bin/ai/compat_1.1.nut b/bin/ai/compat_1.1.nut index 456b054aba..2be06bade0 100644 --- a/bin/ai/compat_1.1.nut +++ b/bin/ai/compat_1.1.nut @@ -5,8 +5,6 @@ * 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 . */ -AILog.Info("1.1 API compatibility in effect."); - AICompany.GetCompanyValue <- function(company) { return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER); @@ -55,32 +53,4 @@ AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID -/* 1.9 adds a vehicle type parameter. */ -AIBridge._GetName <- AIBridge.GetName; -AIBridge.GetName <- function(bridge_id) -{ - return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL); -} - -/* 1.9 adds parent_group_id to CreateGroup function */ -AIGroup._CreateGroup <- AIGroup.CreateGroup; -AIGroup.CreateGroup <- function(vehicle_type) -{ - return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -AIRoad._HasRoadType <- AIRoad.HasRoadType; -AIRoad.HasRoadType <- function(tile, road_type) -{ - local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (AIRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_1.2.nut") diff --git a/bin/ai/compat_1.10.nut b/bin/ai/compat_1.10.nut index 9b82efdcb3..0e9c12e799 100644 --- a/bin/ai/compat_1.10.nut +++ b/bin/ai/compat_1.10.nut @@ -5,20 +5,4 @@ * 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 . */ -AILog.Info("1.10 API compatibility in effect."); - -/* 13 really checks RoadType against RoadType */ -AIRoad._HasRoadType <- AIRoad.HasRoadType; -AIRoad.HasRoadType <- function(tile, road_type) -{ - local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (AIRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_1.11.nut") diff --git a/bin/ai/compat_1.11.nut b/bin/ai/compat_1.11.nut index 1b6bc4da04..c63dfae5ac 100644 --- a/bin/ai/compat_1.11.nut +++ b/bin/ai/compat_1.11.nut @@ -5,20 +5,4 @@ * 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 . */ -AILog.Info("1.11 API compatibility in effect."); - -/* 13 really checks RoadType against RoadType */ -AIRoad._HasRoadType <- AIRoad.HasRoadType; -AIRoad.HasRoadType <- function(tile, road_type) -{ - local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (AIRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_12.nut") diff --git a/bin/ai/compat_1.2.nut b/bin/ai/compat_1.2.nut index 75ffd93d66..bf1040d8dc 100644 --- a/bin/ai/compat_1.2.nut +++ b/bin/ai/compat_1.2.nut @@ -5,34 +5,4 @@ * 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 . */ -AILog.Info("1.2 API compatibility in effect."); - -/* 1.9 adds a vehicle type parameter. */ -AIBridge._GetName <- AIBridge.GetName; -AIBridge.GetName <- function(bridge_id) -{ - return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL); -} - -/* 1.9 adds parent_group_id to CreateGroup function */ -AIGroup._CreateGroup <- AIGroup.CreateGroup; -AIGroup.CreateGroup <- function(vehicle_type) -{ - return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -AIRoad._HasRoadType <- AIRoad.HasRoadType; -AIRoad.HasRoadType <- function(tile, road_type) -{ - local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (AIRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_1.3.nut") diff --git a/bin/ai/compat_1.3.nut b/bin/ai/compat_1.3.nut index 5bc97c2cb2..b872e7d529 100644 --- a/bin/ai/compat_1.3.nut +++ b/bin/ai/compat_1.3.nut @@ -5,34 +5,4 @@ * 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 . */ -AILog.Info("1.3 API compatibility in effect."); - -/* 1.9 adds a vehicle type parameter. */ -AIBridge._GetName <- AIBridge.GetName; -AIBridge.GetName <- function(bridge_id) -{ - return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL); -} - -/* 1.9 adds parent_group_id to CreateGroup function */ -AIGroup._CreateGroup <- AIGroup.CreateGroup; -AIGroup.CreateGroup <- function(vehicle_type) -{ - return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -AIRoad._HasRoadType <- AIRoad.HasRoadType; -AIRoad.HasRoadType <- function(tile, road_type) -{ - local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (AIRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_1.4.nut") diff --git a/bin/ai/compat_1.4.nut b/bin/ai/compat_1.4.nut index 5700c6bfb8..1b779c95e3 100644 --- a/bin/ai/compat_1.4.nut +++ b/bin/ai/compat_1.4.nut @@ -5,34 +5,4 @@ * 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 . */ -AILog.Info("1.4 API compatibility in effect."); - -/* 1.9 adds a vehicle type parameter. */ -AIBridge._GetName <- AIBridge.GetName; -AIBridge.GetName <- function(bridge_id) -{ - return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL); -} - -/* 1.9 adds parent_group_id to CreateGroup function */ -AIGroup._CreateGroup <- AIGroup.CreateGroup; -AIGroup.CreateGroup <- function(vehicle_type) -{ - return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -AIRoad._HasRoadType <- AIRoad.HasRoadType; -AIRoad.HasRoadType <- function(tile, road_type) -{ - local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (AIRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_1.5.nut") diff --git a/bin/ai/compat_1.5.nut b/bin/ai/compat_1.5.nut index 88f4221b4e..386c2279f3 100644 --- a/bin/ai/compat_1.5.nut +++ b/bin/ai/compat_1.5.nut @@ -5,34 +5,4 @@ * 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 . */ -AILog.Info("1.5 API compatibility in effect."); - -/* 1.9 adds a vehicle type parameter. */ -AIBridge._GetName <- AIBridge.GetName; -AIBridge.GetName <- function(bridge_id) -{ - return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL); -} - -/* 1.9 adds parent_group_id to CreateGroup function */ -AIGroup._CreateGroup <- AIGroup.CreateGroup; -AIGroup.CreateGroup <- function(vehicle_type) -{ - return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -AIRoad._HasRoadType <- AIRoad.HasRoadType; -AIRoad.HasRoadType <- function(tile, road_type) -{ - local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (AIRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_1.6.nut") diff --git a/bin/ai/compat_1.6.nut b/bin/ai/compat_1.6.nut index 4ddb4c5bcb..27a89aeb37 100644 --- a/bin/ai/compat_1.6.nut +++ b/bin/ai/compat_1.6.nut @@ -5,34 +5,4 @@ * 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 . */ -AILog.Info("1.6 API compatibility in effect."); - -/* 1.9 adds a vehicle type parameter. */ -AIBridge._GetName <- AIBridge.GetName; -AIBridge.GetName <- function(bridge_id) -{ - return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL); -} - -/* 1.9 adds parent_group_id to CreateGroup function */ -AIGroup._CreateGroup <- AIGroup.CreateGroup; -AIGroup.CreateGroup <- function(vehicle_type) -{ - return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -AIRoad._HasRoadType <- AIRoad.HasRoadType; -AIRoad.HasRoadType <- function(tile, road_type) -{ - local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (AIRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_1.7.nut") diff --git a/bin/ai/compat_1.7.nut b/bin/ai/compat_1.7.nut index 557f13bdc3..d04b44fae4 100644 --- a/bin/ai/compat_1.7.nut +++ b/bin/ai/compat_1.7.nut @@ -5,34 +5,4 @@ * 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 . */ -AILog.Info("1.7 API compatibility in effect."); - -/* 1.9 adds a vehicle type parameter. */ -AIBridge._GetName <- AIBridge.GetName; -AIBridge.GetName <- function(bridge_id) -{ - return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL); -} - -/* 1.9 adds parent_group_id to CreateGroup function */ -AIGroup._CreateGroup <- AIGroup.CreateGroup; -AIGroup.CreateGroup <- function(vehicle_type) -{ - return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -AIRoad._HasRoadType <- AIRoad.HasRoadType; -AIRoad.HasRoadType <- function(tile, road_type) -{ - local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (AIRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_1.8.nut") diff --git a/bin/ai/compat_1.8.nut b/bin/ai/compat_1.8.nut index 8e99a2c0c1..1720fdf440 100644 --- a/bin/ai/compat_1.8.nut +++ b/bin/ai/compat_1.8.nut @@ -5,8 +5,6 @@ * 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 . */ -AILog.Info("1.8 API compatibility in effect."); - /* 1.9 adds a vehicle type parameter. */ AIBridge._GetName <- AIBridge.GetName; AIBridge.GetName <- function(bridge_id) @@ -21,18 +19,4 @@ AIGroup.CreateGroup <- function(vehicle_type) return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID); } -/* 13 really checks RoadType against RoadType */ -AIRoad._HasRoadType <- AIRoad.HasRoadType; -AIRoad.HasRoadType <- function(tile, road_type) -{ - local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (AIRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_1.9.nut") diff --git a/bin/ai/compat_1.9.nut b/bin/ai/compat_1.9.nut index 8301ebb4b8..fe5aab48ce 100644 --- a/bin/ai/compat_1.9.nut +++ b/bin/ai/compat_1.9.nut @@ -5,20 +5,4 @@ * 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 . */ -AILog.Info("1.9 API compatibility in effect."); - -/* 13 really checks RoadType against RoadType */ -AIRoad._HasRoadType <- AIRoad.HasRoadType; -AIRoad.HasRoadType <- function(tile, road_type) -{ - local list = AIRoadTypeList(AIRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (AIRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_1.10.nut") diff --git a/bin/ai/compat_12.nut b/bin/ai/compat_12.nut index 3ac3c66cb7..0e23d41d80 100644 --- a/bin/ai/compat_12.nut +++ b/bin/ai/compat_12.nut @@ -5,8 +5,6 @@ * 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 . */ -AILog.Info("12 API compatibility in effect."); - /* 13 really checks RoadType against RoadType */ AIRoad._HasRoadType <- AIRoad.HasRoadType; AIRoad.HasRoadType <- function(tile, road_type) @@ -20,5 +18,4 @@ AIRoad.HasRoadType <- function(tile, road_type) return false; } -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_13.nut") diff --git a/bin/ai/compat_13.nut b/bin/ai/compat_13.nut index 42311e8001..ea89e6b539 100644 --- a/bin/ai/compat_13.nut +++ b/bin/ai/compat_13.nut @@ -5,7 +5,4 @@ * 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 . */ -AILog.Info("13 API compatibility in effect."); - -/* 15 renames GetBridgeID */ -AIBridge.GetBridgeID <- AIBridge.GetBridgeType; +require("compat_14.nut") diff --git a/bin/ai/compat_14.nut b/bin/ai/compat_14.nut index a303139a69..e8f43301a3 100644 --- a/bin/ai/compat_14.nut +++ b/bin/ai/compat_14.nut @@ -5,7 +5,7 @@ * 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 . */ -AILog.Info("14 API compatibility in effect."); - /* 15 renames GetBridgeID */ AIBridge.GetBridgeID <- AIBridge.GetBridgeType; + +require("compat_15.nut") diff --git a/bin/game/compat_1.10.nut b/bin/game/compat_1.10.nut index 01a611075a..2faf58b2da 100644 --- a/bin/game/compat_1.10.nut +++ b/bin/game/compat_1.10.nut @@ -5,8 +5,6 @@ * 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 . */ -GSLog.Info("1.10 API compatibility in effect."); - /* 1.11 adds a tile parameter. */ GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance; GSCompany.ChangeBankBalance <- function(company, delta, expenses_type) @@ -14,18 +12,4 @@ GSCompany.ChangeBankBalance <- function(company, delta, expenses_type) return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID); } -/* 13 really checks RoadType against RoadType */ -GSRoad._HasRoadType <- GSRoad.HasRoadType; -GSRoad.HasRoadType <- function(tile, road_type) -{ - local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (GSRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -GSBridge.GetBridgeID <- GSBridge.GetBridgeType; +require("compat_1.11.nut") diff --git a/bin/game/compat_1.11.nut b/bin/game/compat_1.11.nut index 9cee3efe3b..c63dfae5ac 100644 --- a/bin/game/compat_1.11.nut +++ b/bin/game/compat_1.11.nut @@ -5,20 +5,4 @@ * 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 . */ -GSLog.Info("1.11 API compatibility in effect."); - -/* 13 really checks RoadType against RoadType */ -GSRoad._HasRoadType <- GSRoad.HasRoadType; -GSRoad.HasRoadType <- function(tile, road_type) -{ - local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (GSRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -GSBridge.GetBridgeID <- GSBridge.GetBridgeType; +require("compat_12.nut") diff --git a/bin/game/compat_1.2.nut b/bin/game/compat_1.2.nut index 662b8a8602..bf1040d8dc 100644 --- a/bin/game/compat_1.2.nut +++ b/bin/game/compat_1.2.nut @@ -5,49 +5,4 @@ * 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 . */ -GSLog.Info("1.2 API compatibility in effect."); - -GSTown._SetGrowthRate <- GSTown.SetGrowthRate; -GSTown.SetGrowthRate <- function(town_id, days_between_town_growth) -{ - /* Growth rate 0 caused resetting the custom growth rate. While this was undocumented, it was used nevertheless (ofc). */ - if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL; - return GSTown._SetGrowthRate(town_id, days_between_town_growth); -} - -/* 1.5 adds a game element reference to the news. */ -GSNews._Create <- GSNews.Create; -GSNews.Create <- function(type, text, company) -{ - return GSNews._Create(type, text, company, GSNews.NR_NONE, 0); -} - -/* 1.9 adds a vehicle type parameter. */ -GSBridge._GetName <- GSBridge.GetName; -GSBridge.GetName <- function(bridge_id) -{ - return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL); -} - -/* 1.11 adds a tile parameter. */ -GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance; -GSCompany.ChangeBankBalance <- function(company, delta, expenses_type) -{ - return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -GSRoad._HasRoadType <- GSRoad.HasRoadType; -GSRoad.HasRoadType <- function(tile, road_type) -{ - local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (GSRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -GSBridge.GetBridgeID <- GSBridge.GetBridgeType; +require("compat_1.3.nut") diff --git a/bin/game/compat_1.3.nut b/bin/game/compat_1.3.nut index 6dd74c008d..0874aa6e16 100644 --- a/bin/game/compat_1.3.nut +++ b/bin/game/compat_1.3.nut @@ -5,8 +5,6 @@ * 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 . */ -GSLog.Info("1.3 API compatibility in effect."); - GSTown._SetGrowthRate <- GSTown.SetGrowthRate; GSTown.SetGrowthRate <- function(town_id, days_between_town_growth) { @@ -15,39 +13,4 @@ GSTown.SetGrowthRate <- function(town_id, days_between_town_growth) return GSTown._SetGrowthRate(town_id, days_between_town_growth); } -/* 1.5 adds a game element reference to the news. */ -GSNews._Create <- GSNews.Create; -GSNews.Create <- function(type, text, company) -{ - return GSNews._Create(type, text, company, GSNews.NR_NONE, 0); -} - -/* 1.9 adds a vehicle type parameter. */ -GSBridge._GetName <- GSBridge.GetName; -GSBridge.GetName <- function(bridge_id) -{ - return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL); -} - -/* 1.11 adds a tile parameter. */ -GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance; -GSCompany.ChangeBankBalance <- function(company, delta, expenses_type) -{ - return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -GSRoad._HasRoadType <- GSRoad.HasRoadType; -GSRoad.HasRoadType <- function(tile, road_type) -{ - local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (GSRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -GSBridge.GetBridgeID <- GSBridge.GetBridgeType; +require("compat_1.4.nut") diff --git a/bin/game/compat_1.4.nut b/bin/game/compat_1.4.nut index 1d53a60642..2bbde15add 100644 --- a/bin/game/compat_1.4.nut +++ b/bin/game/compat_1.4.nut @@ -5,8 +5,6 @@ * 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 . */ -GSLog.Info("1.4 API compatibility in effect."); - /* 1.5 adds a game element reference to the news. */ GSNews._Create <- GSNews.Create; GSNews.Create <- function(type, text, company) @@ -14,32 +12,4 @@ GSNews.Create <- function(type, text, company) return GSNews._Create(type, text, company, GSNews.NR_NONE, 0); } -/* 1.9 adds a vehicle type parameter. */ -GSBridge._GetName <- GSBridge.GetName; -GSBridge.GetName <- function(bridge_id) -{ - return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL); -} - -/* 1.11 adds a tile parameter. */ -GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance; -GSCompany.ChangeBankBalance <- function(company, delta, expenses_type) -{ - return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -GSRoad._HasRoadType <- GSRoad.HasRoadType; -GSRoad.HasRoadType <- function(tile, road_type) -{ - local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (GSRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -GSBridge.GetBridgeID <- GSBridge.GetBridgeType; +require("compat_1.5.nut") diff --git a/bin/game/compat_1.5.nut b/bin/game/compat_1.5.nut index 05fb05253b..386c2279f3 100644 --- a/bin/game/compat_1.5.nut +++ b/bin/game/compat_1.5.nut @@ -5,34 +5,4 @@ * 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 . */ -GSLog.Info("1.5 API compatibility in effect."); - -/* 1.9 adds a vehicle type parameter. */ -GSBridge._GetName <- GSBridge.GetName; -GSBridge.GetName <- function(bridge_id) -{ - return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL); -} - -/* 1.11 adds a tile parameter. */ -GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance; -GSCompany.ChangeBankBalance <- function(company, delta, expenses_type) -{ - return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -GSRoad._HasRoadType <- GSRoad.HasRoadType; -GSRoad.HasRoadType <- function(tile, road_type) -{ - local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (GSRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -GSBridge.GetBridgeID <- GSBridge.GetBridgeType; +require("compat_1.6.nut") diff --git a/bin/game/compat_1.6.nut b/bin/game/compat_1.6.nut index 0ee37890d5..27a89aeb37 100644 --- a/bin/game/compat_1.6.nut +++ b/bin/game/compat_1.6.nut @@ -5,34 +5,4 @@ * 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 . */ -GSLog.Info("1.6 API compatibility in effect."); - -/* 1.9 adds a vehicle type parameter. */ -GSBridge._GetName <- GSBridge.GetName; -GSBridge.GetName <- function(bridge_id) -{ - return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL); -} - -/* 1.11 adds a tile parameter. */ -GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance; -GSCompany.ChangeBankBalance <- function(company, delta, expenses_type) -{ - return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -GSRoad._HasRoadType <- GSRoad.HasRoadType; -GSRoad.HasRoadType <- function(tile, road_type) -{ - local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (GSRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -GSBridge.GetBridgeID <- GSBridge.GetBridgeType; +require("compat_1.7.nut") diff --git a/bin/game/compat_1.7.nut b/bin/game/compat_1.7.nut index 33f607b7f0..d04b44fae4 100644 --- a/bin/game/compat_1.7.nut +++ b/bin/game/compat_1.7.nut @@ -5,34 +5,4 @@ * 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 . */ -GSLog.Info("1.7 API compatibility in effect."); - -/* 1.9 adds a vehicle type parameter. */ -GSBridge._GetName <- GSBridge.GetName; -GSBridge.GetName <- function(bridge_id) -{ - return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL); -} - -/* 1.11 adds a tile parameter. */ -GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance; -GSCompany.ChangeBankBalance <- function(company, delta, expenses_type) -{ - return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -GSRoad._HasRoadType <- GSRoad.HasRoadType; -GSRoad.HasRoadType <- function(tile, road_type) -{ - local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (GSRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -GSBridge.GetBridgeID <- GSBridge.GetBridgeType; +require("compat_1.8.nut") diff --git a/bin/game/compat_1.8.nut b/bin/game/compat_1.8.nut index 9723add99a..50d9425ee9 100644 --- a/bin/game/compat_1.8.nut +++ b/bin/game/compat_1.8.nut @@ -5,8 +5,6 @@ * 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 . */ -GSLog.Info("1.8 API compatibility in effect."); - /* 1.9 adds a vehicle type parameter. */ GSBridge._GetName <- GSBridge.GetName; GSBridge.GetName <- function(bridge_id) @@ -14,25 +12,4 @@ GSBridge.GetName <- function(bridge_id) return GSBridge._GetName(bridge_id, GSVehicle.VT_RAIL); } -/* 1.11 adds a tile parameter. */ -GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance; -GSCompany.ChangeBankBalance <- function(company, delta, expenses_type) -{ - return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -GSRoad._HasRoadType <- GSRoad.HasRoadType; -GSRoad.HasRoadType <- function(tile, road_type) -{ - local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (GSRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -GSBridge.GetBridgeID <- GSBridge.GetBridgeType; +require("compat_1.9.nut") diff --git a/bin/game/compat_1.9.nut b/bin/game/compat_1.9.nut index f9e3b42797..fe5aab48ce 100644 --- a/bin/game/compat_1.9.nut +++ b/bin/game/compat_1.9.nut @@ -5,27 +5,4 @@ * 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 . */ -GSLog.Info("1.9 API compatibility in effect."); - -/* 1.11 adds a tile parameter. */ -GSCompany._ChangeBankBalance <- GSCompany.ChangeBankBalance; -GSCompany.ChangeBankBalance <- function(company, delta, expenses_type) -{ - return GSCompany._ChangeBankBalance(company, delta, expenses_type, GSMap.TILE_INVALID); -} - -/* 13 really checks RoadType against RoadType */ -GSRoad._HasRoadType <- GSRoad.HasRoadType; -GSRoad.HasRoadType <- function(tile, road_type) -{ - local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type)); - foreach (rt, _ in list) { - if (GSRoad._HasRoadType(tile, rt)) { - return true; - } - } - return false; -} - -/* 15 renames GetBridgeID */ -GSBridge.GetBridgeID <- GSBridge.GetBridgeType; +require("compat_1.10.nut") diff --git a/bin/game/compat_12.nut b/bin/game/compat_12.nut index e2e263bd49..551d06d038 100644 --- a/bin/game/compat_12.nut +++ b/bin/game/compat_12.nut @@ -5,8 +5,6 @@ * 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 . */ -GSLog.Info("12 API compatibility in effect."); - /* 13 really checks RoadType against RoadType */ GSRoad._HasRoadType <- GSRoad.HasRoadType; GSRoad.HasRoadType <- function(tile, road_type) @@ -20,5 +18,4 @@ GSRoad.HasRoadType <- function(tile, road_type) return false; } -/* 15 renames GetBridgeID */ -GSBridge.GetBridgeID <- GSBridge.GetBridgeType; +require("compat_13.nut") diff --git a/bin/game/compat_13.nut b/bin/game/compat_13.nut index a9dc9cd87d..ea89e6b539 100644 --- a/bin/game/compat_13.nut +++ b/bin/game/compat_13.nut @@ -5,7 +5,4 @@ * 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 . */ -GSLog.Info("13 API compatibility in effect."); - -/* 15 renames GetBridgeID */ -GSBridge.GetBridgeID <- GSBridge.GetBridgeType; +require("compat_14.nut") diff --git a/bin/game/compat_14.nut b/bin/game/compat_14.nut index 9115d8bcfa..0ab0879a45 100644 --- a/bin/game/compat_14.nut +++ b/bin/game/compat_14.nut @@ -5,7 +5,7 @@ * 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 . */ -GSLog.Info("14 API compatibility in effect."); - /* 15 renames GetBridgeID */ GSBridge.GetBridgeID <- GSBridge.GetBridgeType; + +require("compat_15.nut") diff --git a/src/script/script_instance.cpp b/src/script/script_instance.cpp index 91a15acb6e..c7ab8f9458 100644 --- a/src/script/script_instance.cpp +++ b/src/script/script_instance.cpp @@ -124,6 +124,7 @@ bool ScriptInstance::LoadCompatibilityScripts(const std::string &api_version, Su buf += script_name; if (!FileExists(buf)) continue; + ScriptLog::Info(fmt::format("{} API compatibility in effect.", api_version)); if (this->engine->LoadScript(buf)) return true; ScriptLog::Error("Failed to load API compatibility script");