mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-22 10:21:57 -05:00
Fix #12910: Plugin API: getRide sometimes returns null for valid IDs
This commit is contained in:
parent
ed9c785573
commit
eb18a5db81
2 changed files with 4 additions and 6 deletions
|
@ -18,6 +18,7 @@
|
|||
- Fix: [#12845] Deleting ride with active ad campaign creates incorrect notification.
|
||||
- Fix: [#12857] Incorrect Peep thoughts in imported RCT1 parks.
|
||||
- Fix: [#12881] Guests' favourite rides are not listed in the guest window.
|
||||
- Fix: [#12910] Plugin API: getRide sometimes returns null for valid ride IDs.
|
||||
- Fix: Incomplete loop collision box allowed overlapping track (original bug).
|
||||
- Improved: [#12806] Add Esperanto diacritics to the sprite font.
|
||||
- Improved: [#12890] Add stroke to lowercase 'L' to differentiate from capital 'I'.
|
||||
|
|
|
@ -67,13 +67,10 @@ namespace OpenRCT2::Scripting
|
|||
std::shared_ptr<ScRide> getRide(int32_t id) const
|
||||
{
|
||||
auto rideManager = GetRideManager();
|
||||
if (id >= 0 && id < static_cast<int32_t>(rideManager.size()))
|
||||
auto ride = rideManager[static_cast<ride_id_t>(id)];
|
||||
if (ride != nullptr)
|
||||
{
|
||||
auto ride = rideManager[static_cast<ride_id_t>(id)];
|
||||
if (ride != nullptr)
|
||||
{
|
||||
return std::make_shared<ScRide>(ride->id);
|
||||
}
|
||||
return std::make_shared<ScRide>(ride->id);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue