Remove direct calls to Execute Query on action.

This commit is contained in:
Matt 2019-02-15 08:47:07 +01:00
parent caa490642c
commit 46c9bcc4bc
1 changed files with 12 additions and 4 deletions

View File

@ -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;