mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-25 08:22:17 +00:00
Codechange: use static_cast/to_underlying when explicitly converting Axis
This commit is contained in:
committed by
Peter Nelson
parent
807436b3ea
commit
c0cb8b74e1
+3
-3
@@ -68,7 +68,7 @@ inline BridgeType GetBridgeType(Tile t)
|
||||
inline Axis GetBridgeAxis(Tile t)
|
||||
{
|
||||
assert(IsBridgeAbove(t));
|
||||
return (Axis)(GB(t.type(), 2, 2) - 1);
|
||||
return static_cast<Axis>(GB(t.type(), 2, 2) - 1);
|
||||
}
|
||||
|
||||
TileIndex GetNorthernBridgeEnd(TileIndex t);
|
||||
@@ -93,7 +93,7 @@ inline int GetBridgePixelHeight(TileIndex tile)
|
||||
*/
|
||||
inline void ClearSingleBridgeMiddle(Tile t, Axis a)
|
||||
{
|
||||
ClrBit(t.type(), 2 + a);
|
||||
ClrBit(t.type(), 2 + to_underlying(a));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,7 +113,7 @@ inline void ClearBridgeMiddle(Tile t)
|
||||
*/
|
||||
inline void SetBridgeMiddle(Tile t, Axis a)
|
||||
{
|
||||
SetBit(t.type(), 2 + a);
|
||||
SetBit(t.type(), 2 + to_underlying(a));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -197,7 +197,7 @@ inline Direction DiagDirToDir(DiagDirection dir)
|
||||
inline Axis OtherAxis(Axis a)
|
||||
{
|
||||
assert(IsValidAxis(a));
|
||||
return (Axis)(a ^ 1);
|
||||
return static_cast<Axis>(to_underlying(a) ^ 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ inline Axis OtherAxis(Axis a)
|
||||
inline Axis DiagDirToAxis(DiagDirection d)
|
||||
{
|
||||
assert(IsValidDiagDirection(d));
|
||||
return (Axis)(d & 1);
|
||||
return static_cast<Axis>(d & 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ inline Axis DiagDirToAxis(DiagDirection d)
|
||||
inline DiagDirection AxisToDiagDir(Axis a)
|
||||
{
|
||||
assert(IsValidAxis(a));
|
||||
return (DiagDirection)(2 - a);
|
||||
return static_cast<DiagDirection>(2 - to_underlying(a));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,7 +266,7 @@ inline DiagDirections AxisToDiagDirs(Axis a)
|
||||
inline Direction AxisToDirection(Axis a)
|
||||
{
|
||||
assert(IsValidAxis(a));
|
||||
return (Direction)(5 - 2 * a);
|
||||
return static_cast<Direction>(5 - 2 * to_underlying(a));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -278,7 +278,7 @@ inline Direction AxisToDirection(Axis a)
|
||||
inline DiagDirection XYNSToDiagDir(Axis xy, uint ns)
|
||||
{
|
||||
assert(IsValidAxis(xy));
|
||||
return (DiagDirection)(xy * 3 ^ ns * 2);
|
||||
return static_cast<DiagDirection>(to_underlying(xy) * 3 ^ ns * 2);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -845,9 +845,9 @@ bool DrawStationTile(int x, int y, RailType railtype, Axis axis, StationClassID
|
||||
DrawTileSpriteSpan tmp_rail_layout;
|
||||
|
||||
if (statspec->renderdata.empty()) {
|
||||
sprites = GetStationTileLayout(StationType::Rail, tile + axis);
|
||||
sprites = GetStationTileLayout(StationType::Rail, tile + to_underlying(axis));
|
||||
} else {
|
||||
layout = &statspec->renderdata[(tile < statspec->renderdata.size()) ? tile + axis : (uint)axis];
|
||||
layout = &statspec->renderdata[(tile < statspec->renderdata.size()) ? tile + to_underlying(axis) : to_underlying(axis)];
|
||||
if (!layout->NeedsPreprocessing()) {
|
||||
sprites = layout;
|
||||
layout = nullptr;
|
||||
|
||||
+4
-4
@@ -1738,7 +1738,7 @@ static void DrawTile_Road(TileInfo *ti)
|
||||
|
||||
/* Draw base ground */
|
||||
if (rti->UsesOverlay()) {
|
||||
SpriteID image = SPR_ROAD_Y + axis;
|
||||
SpriteID image = SPR_ROAD_Y + to_underlying(axis);
|
||||
|
||||
Roadside roadside = GetRoadside(ti->tile);
|
||||
if (DrawRoadAsSnowOrDesert(IsOnSnowOrDesert(ti->tile), roadside)) {
|
||||
@@ -1760,7 +1760,7 @@ static void DrawTile_Road(TileInfo *ti)
|
||||
|
||||
DrawGroundSprite(image, pal);
|
||||
} else {
|
||||
SpriteID image = rti->base_sprites.crossing + axis;
|
||||
SpriteID image = rti->base_sprites.crossing + to_underlying(axis);
|
||||
if (IsCrossingBarred(ti->tile)) image += 2;
|
||||
|
||||
Roadside roadside = GetRoadside(ti->tile);
|
||||
@@ -1784,13 +1784,13 @@ static void DrawTile_Road(TileInfo *ti)
|
||||
DrawGroundSprite(image, pal);
|
||||
}
|
||||
|
||||
DrawRoadOverlays(ti, pal, road_rti, tram_rti, axis, axis);
|
||||
DrawRoadOverlays(ti, pal, road_rti, tram_rti, to_underlying(axis), to_underlying(axis));
|
||||
|
||||
/* Draw rail/PBS overlay */
|
||||
bool draw_pbs = _game_mode != GM_MENU && _settings_client.gui.show_track_reservation && HasCrossingReservation(ti->tile);
|
||||
if (rti->UsesOverlay()) {
|
||||
pal = draw_pbs ? PALETTE_CRASH : PAL_NONE;
|
||||
SpriteID rail = GetCustomRailSprite(rti, ti->tile, RailSpriteType::Crossing) + axis;
|
||||
SpriteID rail = GetCustomRailSprite(rti, ti->tile, RailSpriteType::Crossing) + to_underlying(axis);
|
||||
DrawGroundSprite(rail, pal);
|
||||
|
||||
const Axis road_axis = GetCrossingRoadAxis(ti->tile);
|
||||
|
||||
+2
-2
@@ -335,7 +335,7 @@ inline void SetDisallowedRoadDirections(Tile t, DisallowedRoadDirections drd)
|
||||
inline Axis GetCrossingRoadAxis(Tile t)
|
||||
{
|
||||
assert(IsLevelCrossing(t));
|
||||
return (Axis)GB(t.m5(), 0, 1);
|
||||
return static_cast<Axis>(GB(t.m5(), 0, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -676,7 +676,7 @@ inline void MakeRoadCrossing(Tile t, Owner road, Owner tram, Owner rail, Axis ro
|
||||
t.m2() = town.base();
|
||||
t.m3() = 0;
|
||||
t.m4() = INVALID_ROADTYPE;
|
||||
t.m5() = to_underlying(RoadTileType::Crossing) << 6 | roaddir;
|
||||
t.m5() = to_underlying(RoadTileType::Crossing) << 6 | to_underlying(roaddir);
|
||||
SB(t.m6(), 2, 6, 0);
|
||||
t.m7() = road.base();
|
||||
t.m8() = INVALID_ROADTYPE << 6 | rat;
|
||||
|
||||
@@ -1228,7 +1228,7 @@ bool AfterLoadGame()
|
||||
if (MayHaveBridgeAbove(t)) ClearBridgeMiddle(t);
|
||||
if (IsBridgeTile(t)) {
|
||||
if (HasBit(t.m5(), 6)) { // middle part
|
||||
Axis axis = (Axis)GB(t.m5(), 0, 1);
|
||||
Axis axis = static_cast<Axis>(GB(t.m5(), 0, 1));
|
||||
|
||||
if (HasBit(t.m5(), 5)) { // transport route under bridge?
|
||||
if (GB(t.m5(), 3, 2) == TRANSPORT_RAIL) {
|
||||
@@ -1267,7 +1267,7 @@ bool AfterLoadGame()
|
||||
}
|
||||
SetBridgeMiddle(t, axis);
|
||||
} else { // ramp
|
||||
Axis axis = (Axis)GB(t.m5(), 0, 1);
|
||||
Axis axis = static_cast<Axis>(GB(t.m5(), 0, 1));
|
||||
uint north_south = GB(t.m5(), 5, 1);
|
||||
DiagDirection dir = ReverseDiagDir(XYNSToDiagDir(axis, north_south));
|
||||
TransportType type = (TransportType)GB(t.m5(), 1, 2);
|
||||
|
||||
@@ -129,7 +129,7 @@ void MoveWaypointsToBaseStations()
|
||||
bool reserved = !IsSavegameVersionBefore(SLV_100) && HasBit(tile.m5(), 4);
|
||||
|
||||
/* The tile really has our waypoint, so reassign the map array */
|
||||
MakeRailWaypoint(tile, GetTileOwner(tile), new_wp->index, (Axis)GB(tile.m5(), 0, 1), 0, GetRailType(tile));
|
||||
MakeRailWaypoint(tile, GetTileOwner(tile), new_wp->index, static_cast<Axis>(GB(tile.m5(), 0, 1)), 0, GetRailType(tile));
|
||||
new_wp->facilities.Set(StationFacility::Train);
|
||||
new_wp->owner = GetTileOwner(tile);
|
||||
|
||||
|
||||
+5
-5
@@ -1099,7 +1099,7 @@ static CommandCost CheckFlatLandRoadStop(TileIndex cur_tile, int &allowed_z, con
|
||||
if (ret.Failed()) return ret;
|
||||
cost.AddCost(ret.GetCost());
|
||||
|
||||
ret = IsRoadStationBridgeAboveOk(cur_tile, spec, station_type, is_drive_through ? GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + axis : FindFirstBit(invalid_dirs.base()));
|
||||
ret = IsRoadStationBridgeAboveOk(cur_tile, spec, station_type, is_drive_through ? GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + to_underlying(axis) : FindFirstBit(invalid_dirs.base()));
|
||||
if (ret.Failed()) return ret;
|
||||
|
||||
/* If station is set, then we have special handling to allow building on top of already existing stations.
|
||||
@@ -1514,12 +1514,12 @@ CommandCost CmdBuildRailStation(DoCommandFlags flags, TileIndex tile_org, RailTy
|
||||
/* Don't check the layout if there's no bridge above anyway. */
|
||||
if (!IsBridgeAbove(tile)) continue;
|
||||
|
||||
StationGfx gfx = *it + axis;
|
||||
StationGfx gfx = *it + to_underlying(axis);
|
||||
if (statspec != nullptr) {
|
||||
uint32_t platinfo = GetPlatformInfo(AXIS_X, gfx, plat_len, numtracks, j, i, false);
|
||||
/* As the station is not yet completely finished, the station does not yet exist. */
|
||||
uint16_t callback = GetStationCallback(CBID_STATION_BUILD_TILE_LAYOUT, platinfo, 0, statspec, nullptr, INVALID_TILE);
|
||||
if (callback != CALLBACK_FAILED && callback <= UINT8_MAX) gfx = (callback & ~1) + axis;
|
||||
if (callback != CALLBACK_FAILED && callback <= UINT8_MAX) gfx = (callback & ~1) + to_underlying(axis);
|
||||
}
|
||||
|
||||
ret = IsRailStationBridgeAboveOk(tile, statspec, StationType::Rail, gfx);
|
||||
@@ -1598,7 +1598,7 @@ CommandCost CmdBuildRailStation(DoCommandFlags flags, TileIndex tile_org, RailTy
|
||||
uint16_t callback = GetStationCallback(CBID_STATION_BUILD_TILE_LAYOUT, platinfo, 0, statspec, nullptr, tile);
|
||||
if (callback != CALLBACK_FAILED) {
|
||||
if (callback <= UINT8_MAX) {
|
||||
SetStationGfx(tile, (callback & ~1) + axis);
|
||||
SetStationGfx(tile, (callback & ~1) + to_underlying(axis));
|
||||
} else {
|
||||
ErrorUnknownCallbackResult(statspec->grf_prop.grfid, CBID_STATION_BUILD_TILE_LAYOUT, callback);
|
||||
}
|
||||
@@ -3310,7 +3310,7 @@ static void DrawTile_Station(TileInfo *ti)
|
||||
|
||||
if (statspec->callback_mask.Test(StationCallbackMask::DrawTileLayout)) {
|
||||
uint16_t callback = GetStationCallback(CBID_STATION_DRAW_TILE_LAYOUT, 0, 0, statspec, st, ti->tile);
|
||||
if (callback != CALLBACK_FAILED) tile_layout = (callback & ~1) + GetRailStationAxis(ti->tile);
|
||||
if (callback != CALLBACK_FAILED) tile_layout = (callback & ~1) + to_underlying(GetRailStationAxis(ti->tile));
|
||||
}
|
||||
|
||||
/* Ensure the chosen tile layout is valid for this custom station */
|
||||
|
||||
+4
-4
@@ -745,7 +745,7 @@ inline void MakeStation(Tile t, Owner o, StationID sid, StationType st, uint8_t
|
||||
*/
|
||||
inline void MakeRailStation(Tile t, Owner o, StationID sid, Axis a, uint8_t section, RailType rt)
|
||||
{
|
||||
MakeStation(t, o, sid, StationType::Rail, section + a);
|
||||
MakeStation(t, o, sid, StationType::Rail, section + to_underlying(a));
|
||||
SetRailType(t, rt);
|
||||
SetRailStationReservation(t, false);
|
||||
}
|
||||
@@ -761,7 +761,7 @@ inline void MakeRailStation(Tile t, Owner o, StationID sid, Axis a, uint8_t sect
|
||||
*/
|
||||
inline void MakeRailWaypoint(Tile t, Owner o, StationID sid, Axis a, uint8_t section, RailType rt)
|
||||
{
|
||||
MakeStation(t, o, sid, StationType::RailWaypoint, section + a);
|
||||
MakeStation(t, o, sid, StationType::RailWaypoint, section + to_underlying(a));
|
||||
SetRailType(t, rt);
|
||||
SetRailStationReservation(t, false);
|
||||
}
|
||||
@@ -798,7 +798,7 @@ inline void MakeRoadStop(Tile t, Owner o, StationID sid, RoadStopType rst, RoadT
|
||||
*/
|
||||
inline void MakeDriveThroughRoadStop(Tile t, Owner station, Owner road, Owner tram, StationID sid, StationType rst, RoadType road_rt, RoadType tram_rt, Axis a)
|
||||
{
|
||||
MakeStation(t, station, sid, rst, GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + a);
|
||||
MakeStation(t, station, sid, rst, GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + to_underlying(a));
|
||||
SetRoadTypes(t, road_rt, tram_rt);
|
||||
SetRoadOwner(t, RoadTramType::Road, road);
|
||||
SetRoadOwner(t, RoadTramType::Tram, tram);
|
||||
@@ -842,7 +842,7 @@ inline void MakeBuoy(Tile t, StationID sid, WaterClass wc)
|
||||
inline void MakeDock(Tile t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
|
||||
{
|
||||
MakeStation(t, o, sid, StationType::Dock, d);
|
||||
MakeStation(TileIndex(t) + TileOffsByDiagDir(d), o, sid, StationType::Dock, GFX_DOCK_BASE_WATER_PART + DiagDirToAxis(d), wc);
|
||||
MakeStation(TileIndex(t) + TileOffsByDiagDir(d), o, sid, StationType::Dock, GFX_DOCK_BASE_WATER_PART + to_underlying(DiagDirToAxis(d)), wc);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ inline bool IsValidTrackdir(Trackdir trackdir)
|
||||
inline Track AxisToTrack(Axis a)
|
||||
{
|
||||
assert(IsValidAxis(a));
|
||||
return (Track)a;
|
||||
return static_cast<Track>(to_underlying(a));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1407,7 +1407,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
|
||||
if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && HasTunnelBridgeReservation(ti->tile)) {
|
||||
if (rti->UsesOverlay()) {
|
||||
SpriteID overlay = GetCustomRailSprite(rti, ti->tile, RailSpriteType::Overlay);
|
||||
DrawGroundSprite(overlay + RTO_X + DiagDirToAxis(tunnelbridge_direction), PALETTE_CRASH);
|
||||
DrawGroundSprite(overlay + RTO_X + to_underlying(DiagDirToAxis(tunnelbridge_direction)), PALETTE_CRASH);
|
||||
} else {
|
||||
DrawGroundSprite(DiagDirToAxis(tunnelbridge_direction) == AXIS_X ? rti->base_sprites.single_x : rti->base_sprites.single_y, PALETTE_CRASH);
|
||||
}
|
||||
@@ -1508,7 +1508,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
|
||||
if (rti->UsesOverlay()) {
|
||||
SpriteID overlay = GetCustomRailSprite(rti, ti->tile, RailSpriteType::Overlay);
|
||||
if (HasBridgeFlatRamp(ti->tileh, DiagDirToAxis(tunnelbridge_direction))) {
|
||||
AddSortableSpriteToDraw(overlay + RTO_X + DiagDirToAxis(tunnelbridge_direction), PALETTE_CRASH, *ti, {{0, 0, TILE_HEIGHT}, {TILE_SIZE, TILE_SIZE, 0}, {}});
|
||||
AddSortableSpriteToDraw(overlay + RTO_X + to_underlying(DiagDirToAxis(tunnelbridge_direction)), PALETTE_CRASH, *ti, {{0, 0, TILE_HEIGHT}, {TILE_SIZE, TILE_SIZE, 0}, {}});
|
||||
} else {
|
||||
AddSortableSpriteToDraw(overlay + RTO_SLOPE_NE + tunnelbridge_direction, PALETTE_CRASH, *ti, {{}, {TILE_SIZE, TILE_SIZE, TILE_HEIGHT}, {}});
|
||||
}
|
||||
@@ -1667,20 +1667,20 @@ void DrawBridgeMiddle(const TileInfo *ti, BridgePillarFlags blocked_pillars)
|
||||
|
||||
if (transport_type == TRANSPORT_ROAD) {
|
||||
/* DrawBridgeRoadBits() calls EndSpriteCombine() and StartSpriteCombine() */
|
||||
DrawBridgeRoadBits(rampsouth, x, y, bridge_z, axis ^ 1, false, is_custom_layout);
|
||||
DrawBridgeRoadBits(rampsouth, x, y, bridge_z, to_underlying(OtherAxis(axis)), false, is_custom_layout);
|
||||
} else if (transport_type == TRANSPORT_RAIL) {
|
||||
const RailTypeInfo *rti = GetRailTypeInfo(GetRailType(rampsouth));
|
||||
if ((is_custom_layout || rti->UsesOverlay()) && !IsInvisibilitySet(TO_BRIDGES)) {
|
||||
SpriteID surface = rti->UsesOverlay() ? GetCustomRailSprite(rti, rampsouth, RailSpriteType::Bridge, TCX_ON_BRIDGE) : rti->base_sprites.bridge_deck;
|
||||
if (surface != 0) {
|
||||
AddSortableSpriteToDraw(surface + axis, PAL_NONE, x, y, bridge_z, {{}, {TILE_SIZE, TILE_SIZE, 0}, {}}, IsTransparencySet(TO_BRIDGES));
|
||||
AddSortableSpriteToDraw(surface + to_underlying(axis), PAL_NONE, x, y, bridge_z, {{}, {TILE_SIZE, TILE_SIZE, 0}, {}}, IsTransparencySet(TO_BRIDGES));
|
||||
}
|
||||
}
|
||||
|
||||
if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && !IsInvisibilitySet(TO_BRIDGES) && HasTunnelBridgeReservation(rampnorth)) {
|
||||
if (rti->UsesOverlay()) {
|
||||
SpriteID overlay = GetCustomRailSprite(rti, rampnorth, RailSpriteType::Overlay, TCX_ON_BRIDGE);
|
||||
AddSortableSpriteToDraw(overlay + RTO_X + axis, PALETTE_CRASH, ti->x, ti->y, bridge_z, {{}, {TILE_SIZE, TILE_SIZE, 0}, {}}, IsTransparencySet(TO_BRIDGES));
|
||||
AddSortableSpriteToDraw(overlay + RTO_X + to_underlying(axis), PALETTE_CRASH, ti->x, ti->y, bridge_z, {{}, {TILE_SIZE, TILE_SIZE, 0}, {}}, IsTransparencySet(TO_BRIDGES));
|
||||
} else {
|
||||
AddSortableSpriteToDraw(axis == AXIS_X ? rti->base_sprites.single_x : rti->base_sprites.single_y, PALETTE_CRASH, ti->x, ti->y, bridge_z, {{}, {TILE_SIZE, TILE_SIZE, 0}, {}}, IsTransparencySet(TO_BRIDGES));
|
||||
}
|
||||
|
||||
+2
-2
@@ -245,7 +245,7 @@ inline bool IsShipDepotTile(Tile t)
|
||||
inline Axis GetShipDepotAxis(Tile t)
|
||||
{
|
||||
assert(IsShipDepotTile(t));
|
||||
return (Axis)GB(t.m5(), WBL_DEPOT_AXIS, 1);
|
||||
return static_cast<Axis>(GB(t.m5(), WBL_DEPOT_AXIS, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -470,7 +470,7 @@ inline void MakeShipDepot(Tile t, Owner o, DepotID did, DepotPart part, Axis a,
|
||||
t.m2() = did.base();
|
||||
t.m3() = 0;
|
||||
t.m4() = 0;
|
||||
t.m5() = to_underlying(part) << WBL_DEPOT_PART | a << WBL_DEPOT_AXIS;
|
||||
t.m5() = to_underlying(part) << WBL_DEPOT_PART | to_underlying(a) << WBL_DEPOT_AXIS;
|
||||
SetWaterTileType(t, WaterTileType::Depot);
|
||||
SB(t.m6(), 2, 6, 0);
|
||||
t.m7() = 0;
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
void DrawWaypointSprite(int x, int y, StationClassID station_class, uint16_t station_type, RailType railtype)
|
||||
{
|
||||
if (!DrawStationTile(x, y, railtype, AXIS_X, station_class, station_type)) {
|
||||
StationPickerDrawSprite(x, y, StationType::RailWaypoint, railtype, INVALID_ROADTYPE, AXIS_X);
|
||||
StationPickerDrawSprite(x, y, StationType::RailWaypoint, railtype, INVALID_ROADTYPE, to_underlying(AXIS_X));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ static CommandCost IsValidTileForWaypoint(TileIndex tile, Axis axis, StationID *
|
||||
|
||||
Slope tileh = GetTileSlope(tile);
|
||||
if (tileh != SLOPE_FLAT &&
|
||||
(!_settings_game.construction.build_on_slopes || IsSteepSlope(tileh) || !(tileh & (0x3 << axis)) || !(tileh & ~(0x3 << axis)))) {
|
||||
(!_settings_game.construction.build_on_slopes || IsSteepSlope(tileh) || !(tileh & (0x3 << to_underlying(axis))) || !(tileh & ~(0x3 << to_underlying(axis))))) {
|
||||
return CommandCost(STR_ERROR_FLAT_LAND_REQUIRED);
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlags flags, TileIndex start_tile, Axi
|
||||
CommandCost ret = IsValidTileForWaypoint(tile, axis, &est);
|
||||
if (ret.Failed()) return ret;
|
||||
|
||||
ret = IsRailStationBridgeAboveOk(tile, spec, StationType::RailWaypoint, *it + axis);
|
||||
ret = IsRailStationBridgeAboveOk(tile, spec, StationType::RailWaypoint, *it + to_underlying(axis));
|
||||
if (ret.Failed()) return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user