mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r15039) -Codechange: fix comments regarding old AI, remove one old AI hack
This commit is contained in:
parent
2c89bfbc81
commit
26e5ccb60d
@ -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;
|
||||
|
@ -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)
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -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 && (
|
||||
|
@ -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);
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user