From 2c70ccb137c53c59e230699199d94e317b8c5b68 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 26 May 2024 09:53:33 +0100 Subject: [PATCH] Add: [NewGRF] Extended custom waypoint classes. (#12653) This allows waypoints to be split into categories just like stations, instead of all being lumped together. Station class labels with the first byte set to 0xFF will be treated in the same way as the 'WAYP' class. --- src/newgrf_roadstop.h | 2 +- src/newgrf_station.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/newgrf_roadstop.h b/src/newgrf_roadstop.h index e0b1a38ab6..6ec42f508b 100644 --- a/src/newgrf_roadstop.h +++ b/src/newgrf_roadstop.h @@ -188,7 +188,7 @@ void RoadStopUpdateCachedTriggers(BaseStation *st); */ inline bool IsWaypointClass(const RoadStopClass &cls) { - return cls.global_id == ROADSTOP_CLASS_LABEL_WAYPOINT; + return cls.global_id == ROADSTOP_CLASS_LABEL_WAYPOINT || GB(cls.global_id, 24, 8) == UINT8_MAX; } #endif /* NEWGRF_ROADSTATION_H */ diff --git a/src/newgrf_station.h b/src/newgrf_station.h index 5c244a270e..21a833227d 100644 --- a/src/newgrf_station.h +++ b/src/newgrf_station.h @@ -188,7 +188,7 @@ const StationSpec *GetStationSpec(TileIndex t); */ inline bool IsWaypointClass(const StationClass &cls) { - return cls.global_id == STATION_CLASS_LABEL_WAYPOINT; + return cls.global_id == STATION_CLASS_LABEL_WAYPOINT || GB(cls.global_id, 24, 8) == UINT8_MAX; } /* Evaluate a tile's position within a station, and return the result a bitstuffed format. */