mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 19:43:06 +01:00
Verify there is an empty slot for a new ride
This commit is contained in:
committed by
Michał Janiszewski
parent
fe636b5ef4
commit
1dd5d3a3f5
@@ -73,6 +73,13 @@ public:
|
||||
|
||||
GameActionResult::Ptr Query() const override
|
||||
{
|
||||
sint32 rideIndex = ride_get_empty_slot();
|
||||
if (rideIndex == -1)
|
||||
{
|
||||
// No more free slots available.
|
||||
return std::make_unique<RideCreateGameActionResult>(GA_ERROR::NO_FREE_ELEMENTS, STR_NONE);
|
||||
}
|
||||
|
||||
if (_rideType >= RIDE_TYPE_COUNT)
|
||||
{
|
||||
return std::make_unique<RideCreateGameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_INVALID_RIDE_TYPE);
|
||||
|
||||
Reference in New Issue
Block a user