summaryrefslogtreecommitdiff
path: root/src/object_cmd.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-09-03 21:50:51 +0000
committeryexo <yexo@openttd.org>2010-09-03 21:50:51 +0000
commita45b598bfcbbe46acbf9ea95d280fbf8d60a7b47 (patch)
tree4d7e1ca33587bc8097b6b596b789c0cc4f1ca639 /src/object_cmd.cpp
parentbd379e283f4730f11bc40e9c3b583b44f9bc0a0b (diff)
downloadopenttd-a45b598bfcbbe46acbf9ea95d280fbf8d60a7b47.tar.xz
(svn r20729) -Fix [FS#4107]: assert when overbuilding object
Diffstat (limited to 'src/object_cmd.cpp')
-rw-r--r--src/object_cmd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp
index 22abaeec5..2a5c229f6 100644
--- a/src/object_cmd.cpp
+++ b/src/object_cmd.cpp
@@ -342,6 +342,8 @@ static void ReallyClearObjectTile(Object *o)
delete o;
}
+SmallVector<TileArea, 4> _cleared_object_areas;
+
static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags)
{
ObjectType type = GetObjectType(tile);
@@ -351,6 +353,8 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags)
Object *o = Object::GetByTile(tile);
TileArea ta = o->location;
+ *_cleared_object_areas.Append() = ta;
+
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!