Fix 2d7d085e8e: "(Invalid parameter)" in error message when trying to remove another player's object. (#14981)

Formatted error string was thrown away.
This commit is contained in:
Peter Nelson
2025-12-25 17:21:43 +00:00
committed by dP
parent c1e4edb0d3
commit fc8dd8d524

View File

@@ -567,9 +567,9 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlags flags)
} else if (GetTileOwner(tile) == OWNER_NONE) {
/* Owned by nobody and unremovable, so we can only remove it with brute force! */
if (!_cheats.magic_bulldozer.value && spec->flags.Test(ObjectFlag::CannotRemove)) return CMD_ERROR;
} else if (CheckTileOwnership(tile).Failed()) {
} else if (CommandCost ret = CheckTileOwnership(tile); ret.Failed()) {
/* We don't own it!. */
return CommandCost(STR_ERROR_OWNED_BY);
return ret;
} else if (spec->flags.Test(ObjectFlag::CannotRemove) && !spec->flags.Test(ObjectFlag::Autoremove)) {
/* In the game editor or with cheats we can remove, otherwise we can't. */
if (!_cheats.magic_bulldozer.value) {