1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-21 11:22:45 +01:00

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 GitHub
parent a6d66343ac
commit d80ed069b5

View File

@@ -566,9 +566,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) {