From e083116bc70024de2fb48a8b4ca6f7e7356591f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= Date: Fri, 2 Nov 2018 21:13:41 +0100 Subject: [PATCH] Fix #8207: ride_create_command ignoring game action result. (#8208) --- src/openrct2/actions/GameActionCompat.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openrct2/actions/GameActionCompat.cpp b/src/openrct2/actions/GameActionCompat.cpp index f8fae8895c..5e40fc3caa 100644 --- a/src/openrct2/actions/GameActionCompat.cpp +++ b/src/openrct2/actions/GameActionCompat.cpp @@ -122,6 +122,12 @@ money32 ride_create_command(int32_t type, int32_t subType, int32_t flags, uint8_ auto r = GameActions::Execute(&gameAction); const RideCreateGameActionResult* res = static_cast(r.get()); + // Callee's of this function expect MONEY32_UNDEFINED in case of failure. + if (res->Error != GA_ERROR::OK) + { + return MONEY32_UNDEFINED; + } + *outRideIndex = res->rideIndex; *outRideColour = colour1;