summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-01-12 19:49:23 +0000
committersmatz <smatz@openttd.org>2009-01-12 19:49:23 +0000
commit26e5ccb60dfa5c25c11f70424d92c66596c0ec70 (patch)
tree8c77d129ecd4fb627a8b4d4a72f19c9c608a377e
parent2c89bfbc8167c8808be71d08c918d52d92c5300d (diff)
downloadopenttd-26e5ccb60dfa5c25c11f70424d92c66596c0ec70.tar.xz
(svn r15039) -Codechange: fix comments regarding old AI, remove one old AI hack
-rw-r--r--src/command.cpp4
-rw-r--r--src/command_type.h7
-rw-r--r--src/rail_cmd.cpp7
-rw-r--r--src/road_cmd.cpp3
-rw-r--r--src/station_cmd.cpp6
5 files changed, 8 insertions, 19 deletions
diff --git a/src/command.cpp b/src/command.cpp
index 6c1bc6cde..0cb9e7640 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -448,10 +448,6 @@ error:
/* if toplevel, subtract the money. */
if (--_docommand_recursive == 0 && !(flags & DC_BANKRUPT)) {
SubtractMoneyFromCompany(res);
- /* XXX - Old AI hack which doesn't use DoCommandP; update last build coord of company */
- if (tile != 0 && IsValidCompanyID(_current_company)) {
- GetCompany(_current_company)->last_build_coordinate = tile;
- }
}
return res;
diff --git a/src/command_type.h b/src/command_type.h
index e61464504..a4d3b295f 100644
--- a/src/command_type.h
+++ b/src/command_type.h
@@ -301,10 +301,9 @@ enum {
DC_QUERY_COST = 0x004, ///< query cost only, don't build.
DC_NO_WATER = 0x008, ///< don't allow building on water
DC_NO_RAIL_OVERLAP = 0x010, ///< don't allow overlap of rails (used in buildrail)
- DC_AI_BUILDING = 0x020, ///< special building rules for AI
- DC_NO_TOWN_RATING = 0x040, ///< town rating does not disallow you from building
- DC_BANKRUPT = 0x080, ///< company bankrupts, skip money check, skip vehicle on tile check in some cases
- DC_AUTOREPLACE = 0x100, ///< autoreplace/autorenew is in progress, this shall disable vehicle limits when building, and ignore certain restrictions when undoing things (like vehicle attach callback)
+ DC_NO_TOWN_RATING = 0x020, ///< town rating does not disallow you from building
+ DC_BANKRUPT = 0x040, ///< company bankrupts, skip money check, skip vehicle on tile check in some cases
+ DC_AUTOREPLACE = 0x080, ///< autoreplace/autorenew is in progress, this shall disable vehicle limits when building, and ignore certain restrictions when undoing things (like vehicle attach callback)
};
/**
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index e6be82bf8..29b9267e7 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -783,10 +783,9 @@ CommandCost CmdBuildTrainDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p
/* Prohibit construction if
* The tile is non-flat AND
- * 1) The AI is "old-school"
- * 2) build-on-slopes is disabled
- * 3) the tile is steep i.e. spans two height levels
- * 4) the exit points in the wrong direction
+ * 1) build-on-slopes is disabled
+ * 2) the tile is steep i.e. spans two height levels
+ * 3) the exit points in the wrong direction
*/
if (tileh != SLOPE_FLAT && (
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 6ed96d653..71f917272 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -923,8 +923,7 @@ static CommandCost ClearTile_Road(TileIndex tile, byte flags)
case ROAD_TILE_NORMAL: {
RoadBits b = GetAllRoadBits(tile);
- /* Clear the road if only one piece is on the tile OR the AI tries
- * to clear town road OR we are not using the DC_AUTO flag */
+ /* Clear the road if only one piece is on the tile OR we are not using the DC_AUTO flag */
if ((CountBits(b) == 1 && GetRoadBits(tile, ROADTYPE_TRAM) == ROAD_NONE) || !(flags & DC_AUTO)) {
RoadTypes rts = GetRoadTypes(tile);
CommandCost ret(EXPENSES_CONSTRUCTION);
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index f7cda6a77..17c1c9aac 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -739,11 +739,7 @@ CommandCost CheckFlatLandBelow(TileIndex tile, uint w, uint h, uint flags, uint
/* Prohibit building if
* 1) The tile is "steep" (i.e. stretches two height levels)
- * -OR-
- * 2) The tile is non-flat if
- * a) the company building is an "old-school" AI
- * -OR-
- * b) the build_on_slopes switch is disabled
+ * 2) The tile is non-flat and the build_on_slopes switch is disabled
*/
if (IsSteepSlope(tileh) ||
((!_settings_game.construction.build_on_slopes) && tileh != SLOPE_FLAT)) {