MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / RideModeCheckStationPresent

Function RideModeCheckStationPresent

src/openrct2/ride/Ride.cpp:2344–2361  ·  view source on GitHub ↗

* returns stationIndex of first station on success * STATION_INDEX_NULL on failure. */

Source from the content-addressed store, hash-verified

2342 * STATION_INDEX_NULL on failure.
2343 */
2344static StationIndexWithMessage RideModeCheckStationPresent(const Ride& ride)
2345{
2346 auto stationIndex = RideGetFirstValidStationStart(ride);
2347
2348 if (stationIndex.IsNull())
2349 {
2350 const auto& rtd = ride.getRideTypeDescriptor();
2351 if (!rtd.flags.has(RtdFlag::hasTrack))
2352 return { StationIndex::GetNull(), STR_NOT_YET_CONSTRUCTED };
2353
2354 if (rtd.specialType == RtdSpecialType::maze)
2355 return { StationIndex::GetNull(), STR_NOT_YET_CONSTRUCTED };
2356
2357 return { StationIndex::GetNull(), STR_REQUIRES_A_STATION_PLATFORM };
2358 }
2359
2360 return { stationIndex };
2361}
2362
2363/**
2364 *

Callers 1

Calls 3

hasMethod · 0.65
IsNullMethod · 0.45

Tested by

no test coverage detected