mirror of https://github.com/OpenTTD/OpenTTD
(svn r22840) [1.1] -Backport from trunk:
- Fix: Allow to demolish aqueducts built in the scenario editor [FS#4741] (r22821) - Fix: Towns expanding from the "wrong" side of a tunnel or bridge [FS#4731] (r22810, r22809) - Fix: [NewGRF] String codes for dates should use unsigned words, like old OpenTTD did before it learned dates before 1920 (r22774) - Fix: [NoAI] Clarify the meaning of AIStation::IsWithinTownInfluence(), AITile::IsWithinTownInfluence() and AITown::IsWithinTownInfluence() [FS#4702] (r22763)release/1.1
parent
15d5df9496
commit
0ded8c0cb8
|
@ -117,7 +117,8 @@ public:
|
|||
|
||||
/**
|
||||
* Find out if this station is within the rating influence of a town.
|
||||
* Stations within the radius influence the rating of the town.
|
||||
* The service quality of stations with signs within this radius
|
||||
* influences the rating of the town.
|
||||
* @param station_id The station to check.
|
||||
* @param town_id The town to check.
|
||||
* @return True if the tile is within the rating influence of the town.
|
||||
|
|
|
@ -441,7 +441,8 @@ public:
|
|||
|
||||
/**
|
||||
* Find out if this tile is within the rating influence of a town.
|
||||
* Stations on this tile influence the rating of the town.
|
||||
* If a station sign would be on this tile, the servicing quality of the station would
|
||||
* influence the rating of the town.
|
||||
* @param tile The tile to check.
|
||||
* @param town_id The town to check.
|
||||
* @return True if the tile is within the rating influence of the town.
|
||||
|
|
|
@ -209,7 +209,8 @@ public:
|
|||
|
||||
/**
|
||||
* Find out if this tile is within the rating influence of a town.
|
||||
* Stations on this tile influence the rating of the town.
|
||||
* If a station sign would be on this tile, the servicing quality of the station would
|
||||
* influence the rating of the town.
|
||||
* @param town_id The town to check.
|
||||
* @param tile The tile to check.
|
||||
* @pre IsValidTown(town_id).
|
||||
|
|
|
@ -1028,7 +1028,7 @@ uint RemapNewGRFStringControlCode(uint scc, char *buf_start, char **buff, const
|
|||
case SCC_NEWGRF_PRINT_UNSIGNED_WORD: *argv = _newgrf_textrefstack.PopUnsignedWord(); break;
|
||||
|
||||
case SCC_NEWGRF_PRINT_DATE:
|
||||
case SCC_NEWGRF_PRINT_MONTH_YEAR: *argv = _newgrf_textrefstack.PopSignedWord() + DAYS_TILL_ORIGINAL_BASE_YEAR; break;
|
||||
case SCC_NEWGRF_PRINT_MONTH_YEAR: *argv = _newgrf_textrefstack.PopUnsignedWord() + DAYS_TILL_ORIGINAL_BASE_YEAR; break;
|
||||
|
||||
case SCC_NEWGRF_DISCARD_WORD: _newgrf_textrefstack.PopUnsignedWord(); break;
|
||||
|
||||
|
|
|
@ -1110,9 +1110,10 @@ static void GrowTownInTile(TileIndex *tile_ptr, RoadBits cur_rb, DiagDirection t
|
|||
} else {
|
||||
bool allow_house = true; // Value which decides if we want to construct a house
|
||||
|
||||
/* Reached a tunnel/bridge? Then continue at the other side of it. */
|
||||
/* Reached a tunnel/bridge? Then continue at the other side of it, unless
|
||||
* it is the starting tile. Half the time, we stay on this side then.*/
|
||||
if (IsTileType(tile, MP_TUNNELBRIDGE)) {
|
||||
if (GetTunnelBridgeTransportType(tile) == TRANSPORT_ROAD) {
|
||||
if (GetTunnelBridgeTransportType(tile) == TRANSPORT_ROAD && (target_dir != DIAGDIR_END || Chance16(1, 2))) {
|
||||
*tile_ptr = GetOtherTunnelBridgeEnd(tile);
|
||||
}
|
||||
return;
|
||||
|
@ -1236,9 +1237,14 @@ static int GrowTownAtRoad(Town *t, TileIndex tile)
|
|||
return _grow_town_result;
|
||||
}
|
||||
|
||||
/* Select a random bit from the blockmask, walk a step
|
||||
* and continue the search from there. */
|
||||
do target_dir = RandomDiagDir(); while (!(cur_rb & DiagDirToRoadBits(target_dir)));
|
||||
if (IsTileType(tile, MP_TUNNELBRIDGE)) {
|
||||
/* Only build in the direction away from the tunnel or bridge. */
|
||||
target_dir = ReverseDiagDir(GetTunnelBridgeDirection(tile));
|
||||
} else {
|
||||
/* Select a random bit from the blockmask, walk a step
|
||||
* and continue the search from there. */
|
||||
do target_dir = RandomDiagDir(); while (!(cur_rb & DiagDirToRoadBits(target_dir)));
|
||||
}
|
||||
tile = TileAddByDiagDir(tile, target_dir);
|
||||
|
||||
if (IsTileType(tile, MP_ROAD) && !IsRoadDepot(tile) && HasTileRoadType(tile, ROADTYPE_ROAD)) {
|
||||
|
|
|
@ -667,9 +667,15 @@ static inline CommandCost CheckAllowRemoveTunnelBridge(TileIndex tile)
|
|||
}
|
||||
|
||||
case TRANSPORT_RAIL:
|
||||
case TRANSPORT_WATER:
|
||||
return CheckOwnership(GetTileOwner(tile));
|
||||
|
||||
case TRANSPORT_WATER: {
|
||||
/* Always allow to remove aqueducts without owner. */
|
||||
Owner aqueduct_owner = GetTileOwner(tile);
|
||||
if (aqueduct_owner == OWNER_NONE) aqueduct_owner = _current_company;
|
||||
return CheckOwnership(aqueduct_owner);
|
||||
}
|
||||
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue