Codechange: use std::source_location over __FILE__ and __LINE__ for Backup
This commit is contained in:
@@ -662,7 +662,7 @@ static void TileLoop_Town(TileIndex tile)
|
||||
}
|
||||
}
|
||||
|
||||
Backup<CompanyID> cur_company(_current_company, OWNER_TOWN, FILE_LINE);
|
||||
Backup<CompanyID> cur_company(_current_company, OWNER_TOWN);
|
||||
|
||||
if ((hs->building_flags & BUILDING_HAS_1_TILE) &&
|
||||
HasBit(t->flags, TOWN_IS_GROWING) &&
|
||||
@@ -1821,7 +1821,7 @@ static bool GrowTown(Town *t)
|
||||
};
|
||||
|
||||
/* Current "company" is a town */
|
||||
Backup<CompanyID> cur_company(_current_company, OWNER_TOWN, FILE_LINE);
|
||||
Backup<CompanyID> cur_company(_current_company, OWNER_TOWN);
|
||||
|
||||
TileIndex tile = t->xy; // The tile we are working with ATM
|
||||
|
||||
@@ -2108,7 +2108,7 @@ std::tuple<CommandCost, Money, TownID> CmdFoundTown(DoCommandFlag flags, TileInd
|
||||
return { CommandCost(EXPENSES_OTHER), cost.GetCost(), INVALID_TOWN };
|
||||
}
|
||||
|
||||
Backup<bool> old_generating_world(_generating_world, true, FILE_LINE);
|
||||
Backup<bool> old_generating_world(_generating_world, true);
|
||||
UpdateNearestTownForRoadTiles(true);
|
||||
Town *t;
|
||||
if (random_location) {
|
||||
@@ -2303,7 +2303,7 @@ static Town *CreateRandomTown(uint attempts, uint32_t townnameparts, TownSize si
|
||||
* placement is so bad it couldn't grow at all */
|
||||
if (t->cache.population > 0) return t;
|
||||
|
||||
Backup<CompanyID> cur_company(_current_company, OWNER_TOWN, FILE_LINE);
|
||||
Backup<CompanyID> cur_company(_current_company, OWNER_TOWN);
|
||||
[[maybe_unused]] CommandCost rc = Command<CMD_DELETE_TOWN>::Do(DC_EXEC, t->index);
|
||||
cur_company.Restore();
|
||||
assert(rc.Succeeded());
|
||||
@@ -3250,7 +3250,7 @@ static CommandCost TownActionRoadRebuild(Town *t, DoCommandFlag flags)
|
||||
*/
|
||||
static bool CheckClearTile(TileIndex tile)
|
||||
{
|
||||
Backup<CompanyID> cur_company(_current_company, OWNER_NONE, FILE_LINE);
|
||||
Backup<CompanyID> cur_company(_current_company, OWNER_NONE);
|
||||
CommandCost r = Command<CMD_LANDSCAPE_CLEAR>::Do(DC_NONE, tile);
|
||||
cur_company.Restore();
|
||||
return r.Succeeded();
|
||||
@@ -3322,7 +3322,7 @@ static CommandCost TownActionBuildStatue(Town *t, DoCommandFlag flags)
|
||||
if (!CircularTileSearch(&tile, 9, SearchTileForStatue, &statue_data)) return_cmd_error(STR_ERROR_STATUE_NO_SUITABLE_PLACE);
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
Backup<CompanyID> cur_company(_current_company, OWNER_NONE, FILE_LINE);
|
||||
Backup<CompanyID> cur_company(_current_company, OWNER_NONE);
|
||||
Command<CMD_LANDSCAPE_CLEAR>::Do(DC_EXEC, statue_data.best_position);
|
||||
cur_company.Restore();
|
||||
BuildObject(OBJECT_STATUE, statue_data.best_position, _current_company, t);
|
||||
|
Reference in New Issue
Block a user