mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
(svn r22026) -Fix: don't crash when we generate too many objects while generating map
This commit is contained in:
parent
887a7724dc
commit
9cd5243d04
@ -636,7 +636,7 @@ void GenerateObjects()
|
||||
/* add lighthouses */
|
||||
uint maxx = MapMaxX();
|
||||
uint maxy = MapMaxY();
|
||||
for (int loop_count = 0; loop_count < 1000 && lighthouses_to_build != 0; loop_count++) {
|
||||
for (int loop_count = 0; loop_count < 1000 && lighthouses_to_build != 0 && Object::CanAllocateItem(); loop_count++) {
|
||||
uint r = Random();
|
||||
|
||||
/* Scatter the lighthouses more evenly around the perimeter */
|
||||
|
Loading…
Reference in New Issue
Block a user