Changeset - r27285:3bb11625e41b
[Not reviewed]
master
0 2 0
PeterN - 13 months ago 2023-05-08 15:42:01
peter1138@openttd.org
Fix: Set up default station/waypoint classes properly. (#10789)
2 files changed with 8 insertions and 14 deletions:
0 comments (0 inline, 0 general)
src/newgrf_roadstop.cpp
Show inline comments
 
@@ -28,19 +28,16 @@
 
#include "safeguards.h"
 

	
 
template <typename Tspec, typename Tid, Tid Tmax>
 
void NewGRFClass<Tspec, Tid, Tmax>::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 <typename Tspec, typename Tid, Tid Tmax>
 
bool NewGRFClass<Tspec, Tid, Tmax>::IsUIAvailable(uint index) const
 
{
 
	return true;
src/newgrf_station.cpp
Show inline comments
 
@@ -29,19 +29,16 @@
 

	
 

	
 
template <typename Tspec, typename Tid, Tid Tmax>
 
/* static */ void NewGRFClass<Tspec, Tid, Tmax>::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 <typename Tspec, typename Tid, Tid Tmax>
 
bool NewGRFClass<Tspec, Tid, Tmax>::IsUIAvailable(uint index) const
 
{
 
	return true;
0 comments (0 inline, 0 general)