diff --git a/src/ai/api/ai_station.hpp b/src/ai/api/ai_station.hpp index 825c0f3ee3..0faaaf1471 100644 --- a/src/ai/api/ai_station.hpp +++ b/src/ai/api/ai_station.hpp @@ -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. diff --git a/src/ai/api/ai_tile.hpp b/src/ai/api/ai_tile.hpp index 17a292ae3e..557305b404 100644 --- a/src/ai/api/ai_tile.hpp +++ b/src/ai/api/ai_tile.hpp @@ -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. diff --git a/src/ai/api/ai_town.hpp b/src/ai/api/ai_town.hpp index 375dd2a61e..f74dc70f3f 100644 --- a/src/ai/api/ai_town.hpp +++ b/src/ai/api/ai_town.hpp @@ -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). diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index 3ec6c9ab3d..245b9731d0 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -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; diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 1b3faa8c3a..5d616e5d6d 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -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)) { diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index 6e6f4bd25b..e9e67ebb98 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -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(); } }