From 8fac2e14805e79f0d441e5178e3adb137d815626 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Thu, 25 Jan 2018 20:47:57 +0100 Subject: [PATCH] Add guard to ensure game action is registered This also reorders the headers, which caused RideDemolishAction to fail compiling, but that's also solved by adding the namespace before the call. --- src/openrct2/actions/GameAction.cpp | 8 ++++---- src/openrct2/actions/RideDemolishAction.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/actions/GameAction.cpp b/src/openrct2/actions/GameAction.cpp index 87a2c513d9..dd6ab5b204 100644 --- a/src/openrct2/actions/GameAction.cpp +++ b/src/openrct2/actions/GameAction.cpp @@ -19,12 +19,11 @@ #include "../core/Memory.hpp" #include "../core/MemoryStream.h" #include "../core/Util.hpp" -#include "../network/network.h" -#include "GameAction.h" - -#include "../platform/platform.h" #include "../localisation/Localisation.h" +#include "../network/network.h" +#include "../platform/platform.h" #include "../world/Park.h" +#include "GameAction.h" GameActionResult::GameActionResult() { @@ -88,6 +87,7 @@ namespace GameActions result = factory(); } } + Guard::ArgumentNotNull(result); return std::unique_ptr(result); } diff --git a/src/openrct2/actions/RideDemolishAction.hpp b/src/openrct2/actions/RideDemolishAction.hpp index f40a4b4c08..26f7ce6fc9 100644 --- a/src/openrct2/actions/RideDemolishAction.hpp +++ b/src/openrct2/actions/RideDemolishAction.hpp @@ -211,7 +211,7 @@ public: window_close_by_class(WC_NEW_CAMPAIGN); // Refresh windows that display the ride name - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + auto windowManager = OpenRCT2::GetContext()->GetUiContext()->GetWindowManager(); windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_RIDE_LIST)); windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_GUEST_LIST));