summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2012-01-22 21:26:42 +0000
committerrubidium <rubidium@openttd.org>2012-01-22 21:26:42 +0000
commit60a52404e3e4686da8604dbd3709a31830c6ce3f (patch)
tree4efd3bcf4b2bfab4a37ec526b6a05e53a1e5c7b1
parentf591787e4a6b7f368948f07a7ded1f0b2f3fdffa (diff)
downloadopenttd-60a52404e3e4686da8604dbd3709a31830c6ce3f.tar.xz
(svn r23842) -Change [FS#5001, FS#5002]: do not let towns (ever) remove objects
-rw-r--r--src/object_cmd.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp
index 9f1a8377f..9ba2ba83c 100644
--- a/src/object_cmd.cpp
+++ b/src/object_cmd.cpp
@@ -457,6 +457,9 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags)
CommandCost cost(EXPENSES_CONSTRUCTION, spec->GetClearCost() * ta.w * ta.h / 5);
if (spec->flags & OBJECT_FLAG_CLEAR_INCOME) cost.MultiplyCost(-1); // They get an income!
+ /* Towns can't remove any objects. */
+ if (_current_company == OWNER_TOWN) return CMD_ERROR;
+
/* Water can remove everything! */
if (_current_company != OWNER_WATER) {
if ((flags & DC_NO_WATER) && IsTileOnWater(tile)) {