Changeset - r10707:8a385eb35ca8
[Not reviewed]
master
0 5 0
smatz - 15 years ago 2009-01-12 19:49:23
smatz@openttd.org
(svn r15039) -Codechange: fix comments regarding old AI, remove one old AI hack
5 files changed with 8 insertions and 19 deletions:
0 comments (0 inline, 0 general)
src/command.cpp
Show inline comments
 
@@ -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;
src/command_type.h
Show inline comments
 
@@ -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)
 
};
 

	
 
/**
src/rail_cmd.cpp
Show inline comments
 
@@ -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 && (
src/road_cmd.cpp
Show inline comments
 
@@ -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);
src/station_cmd.cpp
Show inline comments
 
@@ -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)) {
0 comments (0 inline, 0 general)