changeset 17326:ed4333ee5e4b draft

(svn r22066) -Fix [FS#4502]: building a statue did not check whether the object pool is full
author rubidium <rubidium@openttd.org>
date Sat, 12 Feb 2011 18:45:05 +0000
parents 46688a193806
children dcc483a10faf
files src/town_cmd.cpp
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -2530,6 +2530,8 @@
  */
 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) {