From 7f998ce80d48e6f34be5d81b00c5384264e90ab3 Mon Sep 17 00:00:00 2001 From: yexo Date: Tue, 26 Jan 2010 23:03:47 +0000 Subject: (svn r18921) -Codechange: make the preconditions for Get/Set CustomStationSpecIndex a bit more strict --- src/station_cmd.cpp | 2 +- src/station_map.h | 4 ++-- src/waypoint_cmd.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 2605595b7..dadbb4859 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1121,7 +1121,7 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32 /* Remove animation if overbuilding */ DeleteAnimatedTile(tile); - byte old_specindex = IsTileType(tile, MP_STATION) ? GetCustomStationSpecIndex(tile) : 0; + byte old_specindex = HasStationTileRail(tile) ? GetCustomStationSpecIndex(tile) : 0; MakeRailStation(tile, st->owner, st->index, axis, layout & ~1, rt); /* Free the spec if we overbuild something */ DeallocateSpecFromStation(st, old_specindex); diff --git a/src/station_map.h b/src/station_map.h index 0ab951b31..55d5c4139 100644 --- a/src/station_map.h +++ b/src/station_map.h @@ -407,13 +407,13 @@ static inline bool IsCustomStationSpecIndex(TileIndex t) static inline void SetCustomStationSpecIndex(TileIndex t, byte specindex) { - assert(IsTileType(t, MP_STATION)); + assert(HasStationTileRail(t)); _m[t].m4 = specindex; } static inline uint GetCustomStationSpecIndex(TileIndex t) { - assert(IsTileType(t, MP_STATION)); + assert(HasStationTileRail(t)); return _m[t].m4; } diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index e2d6486aa..64c5f5f4e 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -306,7 +306,7 @@ CommandCost CmdBuildRailWaypoint(TileIndex start_tile, DoCommandFlag flags, uint for (int i = 0; i < count; i++) { TileIndex tile = start_tile + i * offset; - byte old_specindex = IsTileType(tile, MP_STATION) ? GetCustomStationSpecIndex(tile) : 0; + byte old_specindex = HasStationTileRail(tile) ? GetCustomStationSpecIndex(tile) : 0; bool reserved = IsTileType(tile, MP_RAILWAY) ? HasBit(GetRailReservationTrackBits(tile), AxisToTrack(axis)) : HasStationReservation(tile); -- cgit v1.2.3-70-g09d2