Verify there is an empty slot for a new ride

This commit is contained in:
ZehMatt authored and Michał Janiszewski committed 2017-10-05 10:42:44 +02:00
1 parent fe636b5ef4
commit 1dd5d3a3f5
1 file changed
+7
@@ -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);