Add NewGRFClass helper method for whether class ID is valid (for iteration)

This commit is contained in:
Jonathan G Rennison
2023-01-03 03:51:40 +00:00
parent 417416d19b
commit 6a7cad1b47
7 changed files with 19 additions and 8 deletions

View File

@@ -1374,7 +1374,7 @@ public:
this->roadstop_classes.clear();
for (uint i = 0; i < RoadStopClass::GetClassCount(); i++) {
for (uint i = 0; RoadStopClass::IsClassIDValid((RoadStopClassID)i); i++) {
RoadStopClassID rs_id = (RoadStopClassID)i;
if (rs_id == ROADSTOP_CLASS_WAYP) {
// Skip waypoints.