Changeset - r24751:166b026340d2
[Not reviewed]
master
0 1 0
Charles Pigott - 4 years ago 2021-02-13 17:26:55
charlespigott@googlemail.com
Change: Use a more specific error message when attempting to bulldoze your own HQ
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/object_cmd.cpp
Show inline comments
 
@@ -494,13 +494,16 @@ static CommandCost ClearTile_Object(Tile
 
			if (!_cheats.magic_bulldozer.value && (spec->flags & OBJECT_FLAG_CANNOT_REMOVE) != 0) return CMD_ERROR;
 
		} else if (CheckTileOwnership(tile).Failed()) {
 
			/* We don't own it!. */
 
			return_cmd_error(STR_ERROR_OWNED_BY);
 
		} else if ((spec->flags & OBJECT_FLAG_CANNOT_REMOVE) != 0 && (spec->flags & OBJECT_FLAG_AUTOREMOVE) == 0) {
 
			/* In the game editor or with cheats we can remove, otherwise we can't. */
 
			if (!_cheats.magic_bulldozer.value) return CMD_ERROR;
 
			if (!_cheats.magic_bulldozer.value) {
 
				if (type == OBJECT_HQ) return_cmd_error(STR_ERROR_COMPANY_HEADQUARTERS_IN);
 
				return CMD_ERROR;
 
			}
 

	
 
			/* Removing with the cheat costs more in TTDPatch / the specs. */
 
			cost.MultiplyCost(25);
 
		}
 
	} else if ((spec->flags & (OBJECT_FLAG_BUILT_ON_WATER | OBJECT_FLAG_NOT_ON_LAND)) != 0) {
 
		/* Water can't remove objects that are buildable on water. */
0 comments (0 inline, 0 general)