# HG changeset patch # User PeterN # Date 2023-05-08 15:42:01 # Node ID 3bb11625e41b98d6b8d0d4895121a20861d64259 # Parent 4acfb98837178253ba752b01b256b98cf863f253 Fix: Set up default station/waypoint classes properly. (#10789) diff --git a/src/newgrf_roadstop.cpp b/src/newgrf_roadstop.cpp --- a/src/newgrf_roadstop.cpp +++ b/src/newgrf_roadstop.cpp @@ -31,13 +31,10 @@ template ::InsertDefaults() { /* Set up initial data */ - classes[0].global_id = 'DFLT'; - classes[0].name = STR_STATION_CLASS_DFLT; - classes[0].Insert(nullptr); - - classes[1].global_id = 'WAYP'; - classes[1].name = STR_STATION_CLASS_WAYP; - classes[1].Insert(nullptr); + RoadStopClass::Get(RoadStopClass::Allocate('DFLT'))->name = STR_STATION_CLASS_DFLT; + RoadStopClass::Get(RoadStopClass::Allocate('DFLT'))->Insert(nullptr); + RoadStopClass::Get(RoadStopClass::Allocate('WAYP'))->name = STR_STATION_CLASS_WAYP; + RoadStopClass::Get(RoadStopClass::Allocate('WAYP'))->Insert(nullptr); } template diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -32,13 +32,10 @@ template ::InsertDefaults() { /* Set up initial data */ - classes[0].global_id = 'DFLT'; - classes[0].name = STR_STATION_CLASS_DFLT; - classes[0].Insert(nullptr); - - classes[1].global_id = 'WAYP'; - classes[1].name = STR_STATION_CLASS_WAYP; - classes[1].Insert(nullptr); + StationClass::Get(StationClass::Allocate('DFLT'))->name = STR_STATION_CLASS_DFLT; + StationClass::Get(StationClass::Allocate('DFLT'))->Insert(nullptr); + StationClass::Get(StationClass::Allocate('WAYP'))->name = STR_STATION_CLASS_WAYP; + StationClass::Get(StationClass::Allocate('WAYP'))->Insert(nullptr); } template