mirror of https://github.com/OpenTTD/OpenTTD
(svn r22066) -Fix [FS#4502]: building a statue did not check whether the object pool is full
parent
2d4d43d00c
commit
ece59dc0d1
|
@ -2530,6 +2530,8 @@ static bool SearchTileForStatue(TileIndex tile, void *user_data)
|
||||||
*/
|
*/
|
||||||
static CommandCost TownActionBuildStatue(Town *t, DoCommandFlag flags)
|
static CommandCost TownActionBuildStatue(Town *t, DoCommandFlag flags)
|
||||||
{
|
{
|
||||||
|
if (!Object::CanAllocateItem()) return_cmd_error(STR_ERROR_TOO_MANY_OBJECTS);
|
||||||
|
|
||||||
TileIndex tile = t->xy;
|
TileIndex tile = t->xy;
|
||||||
if (CircularTileSearch(&tile, 9, SearchTileForStatue, NULL)) {
|
if (CircularTileSearch(&tile, 9, SearchTileForStatue, NULL)) {
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
|
|
Loading…
Reference in New Issue