(svn r9333) [NoAI] -Add: added DC_AUTO for DoCommand in AIRoad() to avoid building over existing structures we can remove noai
authortruelight
Mon, 19 Mar 2007 14:17:26 +0000
branchnoai
changeset 9483 0c6d80b1a87e
parent 9482 5e0418292ecc
child 9484 a52f67952f04
(svn r9333) [NoAI] -Add: added DC_AUTO for DoCommand in AIRoad() to avoid building over existing structures we can remove
src/ai/api/ai_road.cpp
--- a/src/ai/api/ai_road.cpp	Mon Mar 19 14:01:29 2007 +0000
+++ b/src/ai/api/ai_road.cpp	Mon Mar 19 14:17:26 2007 +0000
@@ -23,7 +23,7 @@
 	if (TileX(start) != TileX(end) &&
 			TileY(start) != TileY(end)) return false;
 
-	return this->DoCommand(end, start, (TileY(start) != TileY(end) ? 4 : 0) | 3, DC_EXEC, CMD_BUILD_LONG_ROAD);
+	return this->DoCommand(end, start, (TileY(start) != TileY(end) ? 4 : 0) | 3, DC_EXEC | DC_AUTO, CMD_BUILD_LONG_ROAD);
 }
 
 bool AIRoad::BuildRoadDepot(TileIndex tile, TileIndex front)
@@ -33,7 +33,7 @@
 
 	uint entrance_dir = (TileX(tile) == TileX(front)) ? (TileY(tile) < TileY(front) ? 3 : 1) : (TileX(tile) < TileX(front) ? 2: 0);
 
-	return this->DoCommand(tile, entrance_dir, 0, DC_EXEC, CMD_BUILD_ROAD_DEPOT);
+	return this->DoCommand(tile, entrance_dir, 0, DC_EXEC | DC_AUTO, CMD_BUILD_ROAD_DEPOT);
 }
 
 bool AIRoad::BuildRoadStation(TileIndex tile, TileIndex front, bool bus, bool drive_through)
@@ -48,7 +48,7 @@
 		entrance_dir = (TileX(tile) == TileX(front)) ? (TileY(tile) < TileY(front) ? 3 : 1) : (TileX(tile) < TileX(front) ? 2: 0);
 	}
 
-	return this->DoCommand(tile, entrance_dir, drive_through << 1 | bus, DC_EXEC, CMD_BUILD_ROAD_STOP);
+	return this->DoCommand(tile, entrance_dir, drive_through << 1 | bus, DC_EXEC | DC_AUTO, CMD_BUILD_ROAD_STOP);
 }
 
 bool AIRoad::RemoveRoad(TileIndex start, TileIndex end)