Remove direct calls to Execute Query on action.

This commit is contained in:
Matt 2019-02-15 08:55:01 +01:00
parent 22811e0e85
commit 60ec1da0f8
1 changed files with 9 additions and 4 deletions

View File

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