From 60ec1da0f84dbc51e5b85edcb08af8ccf6fb8808 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 15 Feb 2019 08:55:01 +0100 Subject: [PATCH] Remove direct calls to Execute Query on action. --- src/openrct2/world/Map.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 5db7eb3d48..46bf38e5aa 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -1328,8 +1328,10 @@ static money32 lower_land( newSlope &= TILE_ELEMENT_SURFACE_SLOPE_MASK; auto landSetHeightAction = LandSetHeightAction({ x_coord, y_coord }, height, newSlope); - auto res = (flags & GAME_COMMAND_FLAG_APPLY) ? landSetHeightAction.Execute() : landSetHeightAction.Query(); + landSetHeightAction.SetFlags(flags); + auto res = (flags & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landSetHeightAction, false) + : GameActions::Query(&landSetHeightAction, false); if (res->Error != GA_ERROR::OK) { return MONEY32_UNDEFINED; @@ -1580,7 +1582,9 @@ static money32 smooth_land_tile( } auto landSetHeightAction = LandSetHeightAction({ x, y }, targetBaseZ, slope); - auto res = (flags & GAME_COMMAND_FLAG_APPLY) ? landSetHeightAction.Execute() : landSetHeightAction.Query(); + landSetHeightAction.SetFlags(flags); + auto res = (flags & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landSetHeightAction, false) + : GameActions::Query(&landSetHeightAction, false); if (res->Error == GA_ERROR::OK) { @@ -1725,8 +1729,9 @@ static money32 smooth_land_row_by_edge( } } auto landSetHeightAction = LandSetHeightAction({ x, y }, targetBaseZ, slope); - auto res = (flags & GAME_COMMAND_FLAG_APPLY) ? landSetHeightAction.Execute() : landSetHeightAction.Query(); - + landSetHeightAction.SetFlags(flags); + auto res = (flags & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landSetHeightAction, false) + : GameActions::Query(&landSetHeightAction, false); if (res->Error == GA_ERROR::OK) { totalCost += res->Cost;