From a4a66ec1aa2a7772ed174b8dcc1905e9bc5dd02d Mon Sep 17 00:00:00 2001 From: terkhen Date: Wed, 24 Feb 2010 21:55:03 +0000 Subject: (svn r19231) -Feature: Allow overbuilding of road stops. --- bin/ai/compat_0.7.nut | 16 ++++++++++++++++ bin/ai/compat_1.0.nut | 19 +++++++++++++++++-- bin/ai/regression/regression.txt | 16 ++++++++-------- 3 files changed, 41 insertions(+), 10 deletions(-) (limited to 'bin/ai') diff --git a/bin/ai/compat_0.7.nut b/bin/ai/compat_0.7.nut index 3e4b4fa68..db56fdaee 100644 --- a/bin/ai/compat_0.7.nut +++ b/bin/ai/compat_0.7.nut @@ -258,3 +258,19 @@ class AIWaypointList extends _AIWaypointList { ::_AIWaypointList.constructor(AIWaypoint.WAYPOINT_RAIL); } } + +AIRoad._BuildRoadStation <- AIRoad.BuildRoadStation; +AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id) +{ + if (AIRoad.IsRoadStationTile(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)) return false; + + return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id); +} diff --git a/bin/ai/compat_1.0.nut b/bin/ai/compat_1.0.nut index f14520c1e..77ae2525a 100644 --- a/bin/ai/compat_1.0.nut +++ b/bin/ai/compat_1.0.nut @@ -7,5 +7,20 @@ * 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 . */ -/* Enable when adding the first compatability code: - * AILog.Info("1.0 API compatability in effect"); */ +AILog.Info("1.0 API compatability in effect."); + +AIRoad._BuildRoadStation <- AIRoad.BuildRoadStation; +AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id) +{ + if (AIRoad.IsRoadStationTile(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)) return false; + + return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id); +} diff --git a/bin/ai/regression/regression.txt b/bin/ai/regression/regression.txt index be69ce388..aa45f1151 100644 --- a/bin/ai/regression/regression.txt +++ b/bin/ai/regression/regression.txt @@ -7259,7 +7259,7 @@ BuildRoadStation(): false BuildRoadStation(): false BuildRoadStation(): true - BuildRoadStation(): false + BuildRoadStation(): true IsStationTile(): true IsStationTile(): false HasRoadType(Road): true @@ -8452,11 +8452,11 @@ 14 => 1 12 => 1 Age ListDump: + 14 => 1 + 13 => 1 + 12 => 1 17 => 0 16 => 0 - 14 => 0 - 13 => 0 - 12 => 0 MaxAge ListDump: 16 => 10980 14 => 10980 @@ -8465,10 +8465,10 @@ 12 => 5490 AgeLeft ListDump: 16 => 10980 - 14 => 10980 + 14 => 10979 17 => 7320 - 13 => 5490 - 12 => 5490 + 13 => 5489 + 12 => 5489 CurrentSpeed ListDump: 12 => 21 17 => 0 @@ -8486,7 +8486,7 @@ 16 => 0 14 => 0 13 => 0 - 12 => 0 + 12 => -1 ProfitLastYear ListDump: 17 => 0 16 => 0 -- cgit v1.2.3-54-g00ecf