Mercurial > hg > openttd
changeset 16213:82cb9b5c0d02 draft
(svn r20913) -Fix (r19231): [NoAI] give the correct error message if you try to overbuild an opponont road station with your own while using the 0.7 or 1.0 compatibility layer (fanioz)
author | yexo <yexo@openttd.org> |
---|---|
date | Sun, 10 Oct 2010 15:33:22 +0000 |
parents | 32568c477cca |
children | 12f97092cf85 |
files | bin/ai/compat_0.7.nut bin/ai/compat_1.0.nut |
diffstat | 2 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/ai/compat_0.7.nut +++ b/bin/ai/compat_0.7.nut @@ -262,7 +262,7 @@ AIRoad._BuildRoadStation <- AIRoad.BuildRoadStation; AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id) { - if (AIRoad.IsRoadStationTile(tile)) return false; + if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false; return AIRoad._BuildRoadStation(tile, front, road_veh_type, station_id); } @@ -270,7 +270,7 @@ AIRoad._BuildDriveThroughRoadStation <- AIRoad.BuildDriveThroughRoadStation; AIRoad.BuildDriveThroughRoadStation <- function(tile, front, road_veh_type, station_id) { - if (AIRoad.IsRoadStationTile(tile)) return false; + if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false; return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id); }
--- a/bin/ai/compat_1.0.nut +++ b/bin/ai/compat_1.0.nut @@ -12,7 +12,7 @@ AIRoad._BuildRoadStation <- AIRoad.BuildRoadStation; AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id) { - if (AIRoad.IsRoadStationTile(tile)) return false; + if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false; return AIRoad._BuildRoadStation(tile, front, road_veh_type, station_id); } @@ -20,7 +20,7 @@ AIRoad._BuildDriveThroughRoadStation <- AIRoad.BuildDriveThroughRoadStation; AIRoad.BuildDriveThroughRoadStation <- function(tile, front, road_veh_type, station_id) { - if (AIRoad.IsRoadStationTile(tile)) return false; + if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false; return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id); }