mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Merge pull request #11718 from MegaMech/patch-1
Added check to prevent overflow assertion error
This commit is contained in:
@@ -78,6 +78,15 @@ public:
|
||||
return res;
|
||||
}
|
||||
|
||||
if (_status >= RIDE_STATUS_COUNT)
|
||||
{
|
||||
log_warning("Invalid ride status %u for ride %u", uint32_t(_status), uint32_t(_rideIndex));
|
||||
res->Error = GA_ERROR::INVALID_PARAMETERS;
|
||||
res->ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN;
|
||||
res->ErrorMessage = STR_NONE;
|
||||
return res;
|
||||
}
|
||||
|
||||
res->ErrorTitle = _StatusErrorTitles[_status];
|
||||
ride->FormatNameTo(res->ErrorMessageArgs.data() + 6);
|
||||
if (_status != ride->status)
|
||||
|
||||
@@ -630,6 +630,7 @@ enum
|
||||
RIDE_STATUS_OPEN,
|
||||
RIDE_STATUS_TESTING,
|
||||
RIDE_STATUS_SIMULATING,
|
||||
RIDE_STATUS_COUNT,
|
||||
};
|
||||
|
||||
enum : uint8_t
|
||||
|
||||
Reference in New Issue
Block a user