MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / IsActive

Method IsActive

src/road_gui.cpp:1204–1216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1202 StringID GetTypeTooltip() const override;
1203
1204 bool IsActive() const override
1205 {
1206 for (const auto &cls : RoadStopClass::Classes()) {
1207 if (IsWaypointClass(cls)) continue;
1208 for (const auto *spec : cls.Specs()) {
1209 if (spec == nullptr) continue;
1210 if (roadstoptype == RoadStopType::Truck && spec->stop_type != ROADSTOPTYPE_FREIGHT && spec->stop_type != ROADSTOPTYPE_ALL) continue;
1211 if (roadstoptype == RoadStopType::Bus && spec->stop_type != ROADSTOPTYPE_PASSENGER && spec->stop_type != ROADSTOPTYPE_ALL) continue;
1212 return true;
1213 }
1214 }
1215 return false;
1216 }
1217
1218 static bool IsClassChoice(const RoadStopClass &cls)
1219 {

Callers 1

Calls 2

SpecsMethod · 0.80
IsWaypointClassFunction · 0.70

Tested by

no test coverage detected