mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 23:50:25 +00:00
(svn r22065) -Fix [FS#4500]: pool allocation checks triggered when towns could not be built
This commit is contained in:
parent
d8cada7563
commit
2d4d43d00c
@ -1756,6 +1756,12 @@ static Town *CreateRandomTown(uint attempts, uint32 townnameparts, TownSize size
|
||||
* placement is so bad it couldn't grow at all */
|
||||
if (t->population > 0) return t;
|
||||
DoCommand(t->xy, t->index, 0, DC_EXEC, CMD_DELETE_TOWN);
|
||||
|
||||
/* We already know that we can allocate a single town when
|
||||
* entering this function. However, we create and delete
|
||||
* a town which "resets" the allocation checks. As such we
|
||||
* need to check again when assertions are enabled. */
|
||||
assert(Town::CanAllocateItem());
|
||||
} while (--attempts != 0);
|
||||
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user