# HG changeset patch # User kiwitreekor # Date 2023-05-07 18:04:34 # Node ID f456603f9cabda7d02d551d92953c3b839200079 # Parent 44cfdb7649c70beba39da81dccb3cb5e697f4856 Fix: Var68 for station and roadstop was broken (#10784) diff --git a/src/newgrf_roadstop.cpp b/src/newgrf_roadstop.cpp --- a/src/newgrf_roadstop.cpp +++ b/src/newgrf_roadstop.cpp @@ -157,7 +157,7 @@ uint32 RoadStopScopeResolver::GetVariabl if (IsCustomRoadStopSpecIndex(nearby_tile)) { const RoadStopSpecList ssl = BaseStation::GetByTile(nearby_tile)->roadstop_speclist[GetCustomRoadStopSpecIndex(nearby_tile)]; - res |= 1 << (ssl.grfid != grfid ? 9 : 8) | std::max(ssl.localidx, 0xFF); + res |= 1 << (ssl.grfid != grfid ? 9 : 8) | ClampTo(ssl.localidx); } return res; } diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -364,7 +364,7 @@ TownScopeResolver *StationResolverObject if (IsCustomStationSpecIndex(nearby_tile)) { const StationSpecList ssl = BaseStation::GetByTile(nearby_tile)->speclist[GetCustomStationSpecIndex(nearby_tile)]; - res |= 1 << (ssl.grfid != grfid ? 9 : 8) | std::max(ssl.localidx, 0xFF); + res |= 1 << (ssl.grfid != grfid ? 9 : 8) | ClampTo(ssl.localidx); } return res; }