Mercurial > hg > openttd
changeset 5028:43d379025dc8 draft
(svn r7069) -Fix: AI tried to build road from the back or side of road stop/depot (peter1138)
author | KUDr <KUDr@openttd.org> |
---|---|
date | Sun, 05 Nov 2006 18:42:25 +0000 |
parents | ef34a6dbef98 |
children | 26aa4c33a28c |
files | ai/default/default.c pathfind.c |
diffstat | 2 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/ai/default/default.c +++ b/ai/default/default.c @@ -2806,6 +2806,7 @@ are.dest = p->ai.cur_tile_b; tile = TILE_MASK(p->ai.cur_tile_a + TileOffsByDiagDir(dir)); + if (IsRoadStopTile(tile) || IsTileDepotType(tile, TRANSPORT_ROAD)) return false; bits = GetTileTrackStatus(tile, TRANSPORT_ROAD) & _ai_road_table_and[dir]; if (bits == 0) return false;
--- a/pathfind.c +++ b/pathfind.c @@ -294,9 +294,9 @@ if (tpf->tracktype == TRANSPORT_ROAD) { // road stops and depots now have a track (r4419) // don't enter road stop from the back - if (IsRoadStopTile(tile) && GetRoadStopDir(tile) == direction) return; + if (IsRoadStopTile(tile) && ReverseDiagDir(GetRoadStopDir(tile)) != direction) return; // don't enter road depot from the back - if (IsTileDepotType(tile, TRANSPORT_ROAD) && GetRoadDepotDirection(tile) == direction) return; + if (IsTileDepotType(tile, TRANSPORT_ROAD) && ReverseDiagDir(GetRoadDepotDirection(tile)) != direction) return; } tpf->rd.cur_length++;