From 46c9bcc4bcf55d1e97e0d66f8548f742907342d2 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 15 Feb 2019 08:47:07 +0100 Subject: [PATCH] Remove direct calls to Execute Query on action. --- src/openrct2/actions/ClearAction.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/ClearAction.hpp b/src/openrct2/actions/ClearAction.hpp index ba5e28ddee..331e268f43 100644 --- a/src/openrct2/actions/ClearAction.hpp +++ b/src/openrct2/actions/ClearAction.hpp @@ -155,7 +155,9 @@ private: auto footpathRemoveAction = FootpathRemoveAction(x * 32, y * 32, tileElement->base_height); footpathRemoveAction.SetFlags(GetFlags()); - auto res = executing ? footpathRemoveAction.Execute() : footpathRemoveAction.Query(); + auto res = executing ? GameActions::Execute(&footpathRemoveAction, false) + : GameActions::Query(&footpathRemoveAction, false); + if (res->Error != GA_ERROR::OK) return MONEY32_UNDEFINED; @@ -171,7 +173,9 @@ private: tileElement->AsSmallScenery()->GetEntryIndex()); removeSceneryAction.SetFlags(GetFlags()); - auto res = executing ? removeSceneryAction.Execute() : removeSceneryAction.Query(); + auto res = executing ? GameActions::Execute(&removeSceneryAction, false) + : GameActions::Query(&removeSceneryAction, false); + if (res->Error != GA_ERROR::OK) return MONEY32_UNDEFINED; @@ -186,7 +190,9 @@ private: auto wallRemoveAction = WallRemoveAction(wallLocation); wallRemoveAction.SetFlags(GetFlags()); - auto res = executing ? wallRemoveAction.Execute() : wallRemoveAction.Query(); + auto res = executing ? GameActions::Execute(&wallRemoveAction, false) + : GameActions::Query(&wallRemoveAction, false); + if (res->Error != GA_ERROR::OK) return MONEY32_UNDEFINED; @@ -202,7 +208,9 @@ private: tileElement->AsLargeScenery()->GetSequenceIndex()); removeSceneryAction.SetFlags(GetFlags() | GAME_COMMAND_FLAG_PATH_SCENERY); - auto res = executing ? removeSceneryAction.Execute() : removeSceneryAction.Query(); + auto res = executing ? GameActions::Execute(&removeSceneryAction, false) + : GameActions::Query(&removeSceneryAction, false); + if (res->Error != GA_ERROR::OK) return MONEY32_UNDEFINED;