summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-02-12 18:45:05 +0000
committerrubidium <rubidium@openttd.org>2011-02-12 18:45:05 +0000
commitece59dc0d1cd21a4e55322ee31439f7f4baec72d (patch)
tree30fb0d3dc0d53ed74fbfa14b964cc979ab3e6d68 /src
parent2d4d43d00ce098d9f3de47ce878aa8477fd1f6c8 (diff)
downloadopenttd-ece59dc0d1cd21a4e55322ee31439f7f4baec72d.tar.xz
(svn r22066) -Fix [FS#4502]: building a statue did not check whether the object pool is full
Diffstat (limited to 'src')
-rw-r--r--src/town_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 43961273d..badcb844c 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -2530,6 +2530,8 @@ static bool SearchTileForStatue(TileIndex tile, void *user_data)
*/
static CommandCost TownActionBuildStatue(Town *t, DoCommandFlag flags)
{
+ if (!Object::CanAllocateItem()) return_cmd_error(STR_ERROR_TOO_MANY_OBJECTS);
+
TileIndex tile = t->xy;
if (CircularTileSearch(&tile, 9, SearchTileForStatue, NULL)) {
if (flags & DC_EXEC) {