| 5263 | } |
| 5264 | |
| 5265 | ObjectEntryIndex RideGetEntryIndex(ride_type_t rideType, ObjectEntryIndex rideSubType) |
| 5266 | { |
| 5267 | auto subType = rideSubType; |
| 5268 | |
| 5269 | if (subType == kObjectEntryIndexNull) |
| 5270 | { |
| 5271 | auto& objManager = GetContext()->GetObjectManager(); |
| 5272 | auto& rideEntries = objManager.GetAllRideEntries(rideType); |
| 5273 | if (!rideEntries.empty()) |
| 5274 | { |
| 5275 | subType = rideEntries[0]; |
| 5276 | for (auto rideEntryIndex : rideEntries) |
| 5277 | { |
| 5278 | const auto* rideEntry = GetRideEntryByIndex(rideEntryIndex); |
| 5279 | if (rideEntry == nullptr) |
| 5280 | { |
| 5281 | return kObjectEntryIndexNull; |
| 5282 | } |
| 5283 | |
| 5284 | // Can happen in select-by-track-type mode |
| 5285 | if (!RideEntryIsInvented(rideEntryIndex) && !getGameState().cheats.ignoreResearchStatus) |
| 5286 | { |
| 5287 | continue; |
| 5288 | } |
| 5289 | |
| 5290 | if (!GetRideTypeDescriptor(rideType).flags.has(RtdFlag::listVehiclesSeparately)) |
| 5291 | { |
| 5292 | subType = rideEntryIndex; |
| 5293 | break; |
| 5294 | } |
| 5295 | } |
| 5296 | } |
| 5297 | } |
| 5298 | |
| 5299 | return subType; |
| 5300 | } |
| 5301 | |
| 5302 | const StationObject* Ride::getStationObject() const |
| 5303 | { |
no test coverage detected