1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-02-02 17:11:20 +01:00

Codechange: use std::move over copying where applicable

This commit is contained in:
Rubidium
2025-03-16 16:32:05 +01:00
committed by rubidium42
parent f214c81e97
commit 5ea5855677
7 changed files with 16 additions and 16 deletions

View File

@@ -349,10 +349,10 @@ std::tuple<CommandCost, Money, TileIndex> CmdLevelLand(DoCommandFlags flags, Til
CommandCost ret;
std::tie(ret, std::ignore, error_tile) = Command<CMD_TERRAFORM_LAND>::Do(DoCommandFlags{flags}.Reset(DoCommandFlag::Execute), t, SLOPE_N, curh <= h);
if (ret.Failed()) {
last_error = ret;
last_error = std::move(ret);
/* Did we reach the limit? */
if (ret.GetErrorMessage() == STR_ERROR_TERRAFORM_LIMIT_REACHED) limit = 0;
if (last_error.GetErrorMessage() == STR_ERROR_TERRAFORM_LIMIT_REACHED) limit = 0;
break;
}