1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-22 14:09:10 +00:00

Fix e114ed357d: Incorrect test of object flags allowed HQ to be removed.

This commit is contained in:
2025-04-21 14:48:08 +01:00
parent 788845f731
commit 44e541be44

View File

@@ -571,7 +571,7 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlags flags)
} else if (CheckTileOwnership(tile).Failed()) {
/* We don't own it!. */
return CommandCost(STR_ERROR_OWNED_BY);
} else if (spec->flags.All({ObjectFlag::CannotRemove, ObjectFlag::Autoremove})) {
} 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) {
if (type == OBJECT_HQ) return CommandCost(STR_ERROR_COMPANY_HEADQUARTERS_IN);