# HG changeset patch # User smatz # Date 2009-01-12 19:49:23 # Node ID 8a385eb35ca8949a8c4a50fe5ad3c90730f37f6d # Parent 1df70cb6bed3e1e255feecc10949a4ceed356891 (svn r15039) -Codechange: fix comments regarding old AI, remove one old AI hack diff --git a/src/command.cpp b/src/command.cpp --- 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 --- 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 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -783,10 +783,9 @@ CommandCost CmdBuildTrainDepot(TileIndex /* 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 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -923,8 +923,7 @@ static CommandCost ClearTile_Road(TileIn 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 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -739,11 +739,7 @@ CommandCost CheckFlatLandBelow(TileIndex /* 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)) {