summaryrefslogtreecommitdiff
path: root/rail_cmd.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-08-20 09:32:32 +0000
committertruelight <truelight@openttd.org>2004-08-20 09:32:32 +0000
commit788ace088d8b3ba2afd77a8b21b532abc40d9eba (patch)
tree493248c0850e836b9a0d35c0fdddf9673b2a01b3 /rail_cmd.c
parent80b1e25b6ce190a773ab9fe50927a983c8f2d038 (diff)
downloadopenttd-788ace088d8b3ba2afd77a8b21b532abc40d9eba.tar.xz
(svn r85) -Add: initial commit of new AI (enable in Patch menu)
-Add: generalised A* Algorithm -Add: generalised queues (Fifo, Stack, InsSort, BinaryHeap)
Diffstat (limited to 'rail_cmd.c')
-rw-r--r--rail_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rail_cmd.c b/rail_cmd.c
index bb8736c67..567e0c973 100644
--- a/rail_cmd.c
+++ b/rail_cmd.c
@@ -203,7 +203,7 @@ static const byte _valid_tileh_slopes[4][15] = {
}
};
-static uint GetRailFoundation(uint tileh, uint bits)
+uint GetRailFoundation(uint tileh, uint bits)
{
int i;
@@ -351,7 +351,7 @@ need_clear:;
cost += ret;
// the AI is not allowed to used foundationed tiles.
- if (ret && (_is_ai_player || !_patches.build_on_slopes))
+ if (ret && (!_patches.build_on_slopes || (!_patches.ainew_active && _is_ai_player)))
return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
if (flags & DC_EXEC && need_clear) {
@@ -628,7 +628,7 @@ int32 CmdBuildTrainDepot(int x, int y, uint32 flags, uint32 p1, uint32 p2)
tileh = GetTileSlope(tile, NULL);
if (tileh != 0) {
- if (_is_ai_player || !_patches.build_on_slopes || (tileh & 0x10 || !((0x4C >> p2) & tileh) ))
+ if ((!_patches.ainew_active && _is_ai_player) || !_patches.build_on_slopes || (tileh & 0x10 || !((0x4C >> p2) & tileh) ))
return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
}