summaryrefslogtreecommitdiff
path: root/road_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 /road_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 'road_cmd.c')
-rw-r--r--road_cmd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/road_cmd.c b/road_cmd.c
index 441e1dff8..e782430e0 100644
--- a/road_cmd.c
+++ b/road_cmd.c
@@ -16,7 +16,7 @@ static bool _road_special_gettrackstatus;
void RoadVehEnterDepot(Vehicle *v);
-static bool HasTileRoadAt(uint tile, int i)
+bool HasTileRoadAt(uint tile, int i)
{
int mask;
byte b;
@@ -424,8 +424,7 @@ do_clear:;
cost = CheckRoadSlope(ti.tileh, &pieces, existing);
if (cost == CMD_ERROR) return_cmd_error(STR_1800_LAND_SLOPED_IN_WRONG_DIRECTION);
- // the AI is not allowed to used foundationed tiles.
- if (cost && (_is_ai_player || !_patches.build_on_slopes))
+ if (cost && (!_patches.build_on_slopes || (!_patches.ainew_active && _is_ai_player)))
return CMD_ERROR;
if (!(ti.type == MP_STREET && (ti.map5 & 0xF0) == 0)) {
@@ -600,7 +599,7 @@ int32 CmdBuildRoadDepot(int x, int y, uint32 flags, uint32 p1, uint32 p2)
return CMD_ERROR;
if (ti.tileh != 0) {
- if (_is_ai_player || !_patches.build_on_slopes || (ti.tileh & 0x10 || !((0x4C >> p1) & ti.tileh) ))
+ if (!_patches.build_on_slopes || (ti.tileh & 0x10 || !((0x4C >> p1) & ti.tileh) ))
return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
}
@@ -696,7 +695,7 @@ typedef struct DrawRoadSeqStruct {
#include "table/road_land.h"
-static uint GetRoadFoundation(uint tileh, uint bits) {
+uint GetRoadFoundation(uint tileh, uint bits) {
int i;
// normal level sloped building
if ((~_valid_tileh_slopes_road[1][tileh] & bits) == 0)