(svn r85) -Add: initial commit of new AI (enable in Patch menu)

-Add: generalised A* Algorithm
-Add: generalised queues (Fifo, Stack, InsSort, BinaryHeap)
This commit is contained in:
truelight
2004-08-20 09:32:32 +00:00
parent 80b1e25b6c
commit 788ace088d
23 changed files with 3688 additions and 27 deletions

View File

@@ -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);
}