Codechange: Add base() method to StrongType to allow access to the base type without casting. (#11445)

This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
This commit is contained in:
Peter Nelson
2023-11-06 20:29:35 +00:00
committed by GitHub
parent 737775f834
commit ab535c0a86
73 changed files with 174 additions and 173 deletions

View File

@@ -1664,7 +1664,7 @@ CommandCost RemoveFromRailBaseStation(TileArea ta, std::vector<T *> &affected_st
if (!build_rail && !IsStationTileBlocked(tile)) Company::Get(owner)->infrastructure.rail[rt]--;
DoClearSquare(tile);
DeleteNewGRFInspectWindow(GSF_STATIONS, static_cast<uint32_t>(tile));
DeleteNewGRFInspectWindow(GSF_STATIONS, tile.base());
if (build_rail) MakeRailNormal(tile, owner, TrackToTrackBits(track), rt);
Company::Get(owner)->infrastructure.station--;
DirtyCompanyInfrastructureWindows(owner);
@@ -2162,7 +2162,7 @@ static CommandCost RemoveRoadStop(TileIndex tile, DoCommandFlag flags, int repla
uint specindex = GetCustomRoadStopSpecIndex(tile);
DeleteNewGRFInspectWindow(GSF_ROADSTOPS, static_cast<uint32_t>(tile));
DeleteNewGRFInspectWindow(GSF_ROADSTOPS, tile.base());
if (IsDriveThroughStopTile(tile)) {
/* Clears the tile for us */
@@ -2546,7 +2546,7 @@ static CommandCost RemoveAirport(TileIndex tile, DoCommandFlag flags)
if (flags & DC_EXEC) {
DeleteAnimatedTile(tile_cur);
DoClearSquare(tile_cur);
DeleteNewGRFInspectWindow(GSF_AIRPORTTILES, static_cast<uint32_t>(tile_cur));
DeleteNewGRFInspectWindow(GSF_AIRPORTTILES, tile_cur.base());
}
}