Merge remote-tracking branch 'upstream/1.11' into 1.11

This commit is contained in:
dP
2021-03-15 20:11:52 +03:00
327 changed files with 31198 additions and 8572 deletions

View File

@@ -1266,7 +1266,7 @@ static bool GrowTownWithRoad(const Town *t, TileIndex tile, RoadBits rcmd)
* @param road_dir The direction of the road
* @return true if the road can be continued, else false
*/
static bool CanRoadContinueIntoNextTile(const Town* t, const TileIndex tile, const DiagDirection road_dir)
static bool CanRoadContinueIntoNextTile(const Town *t, const TileIndex tile, const DiagDirection road_dir)
{
const int delta = TileOffsByDiagDir(road_dir); // +1 tile in the direction of the road
TileIndex next_tile = tile + delta; // The tile beyond which must be connectable to the target tile
@@ -1385,7 +1385,7 @@ static bool GrowTownWithBridge(const Town *t, const TileIndex tile, const DiagDi
* @param tunnel_dir The valid direction in which to grow a tunnel
* @return true if a tunnel has been built, else false
*/
static bool GrowTownWithTunnel(const Town* t, const TileIndex tile, const DiagDirection tunnel_dir)
static bool GrowTownWithTunnel(const Town *t, const TileIndex tile, const DiagDirection tunnel_dir)
{
assert(tunnel_dir < DIAGDIR_END);
@@ -1405,6 +1405,7 @@ static bool GrowTownWithTunnel(const Town* t, const TileIndex tile, const DiagDi
/* Only tunnel under a mountain if the slope is continuous for at least 4 tiles. We want tunneling to be a last resort for large hills. */
TileIndex slope_tile = tile;
for (uint8 tiles = 0; tiles < 4; tiles++) {
if (!IsValidTile(slope_tile)) return false;
slope = GetTileSlope(slope_tile);
if (slope != InclinedSlope(tunnel_dir) && !IsSteepSlope(slope) && !IsSlopeWithOneCornerRaised(slope)) return false;
slope_tile += delta;
@@ -2129,15 +2130,10 @@ static void DoCreateTown(Town *t, TileIndex tile, uint32 townnameparts, TownSize
t->exclusive_counter = 0;
t->statues = 0;
extern int _nb_orig_names;
if (_settings_game.game_creation.town_name < _nb_orig_names) {
/* Original town name */
t->townnamegrfid = 0;
t->townnametype = SPECSTR_TOWNNAME_START + _settings_game.game_creation.town_name;
} else {
/* Newgrf town name */
t->townnamegrfid = GetGRFTownNameId(_settings_game.game_creation.town_name - _nb_orig_names);
t->townnametype = GetGRFTownNameType(_settings_game.game_creation.town_name - _nb_orig_names);
{
TownNameParams tnp(_settings_game.game_creation.town_name);
t->townnamegrfid = tnp.grfid;
t->townnametype = tnp.type;
}
t->townnameparts = townnameparts;