(svn r22026) -Fix: don't crash when we generate too many objects while generating map

This commit is contained in:
smatz 2011-02-08 18:39:29 +00:00
parent 887a7724dc
commit 9cd5243d04

View File

@ -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 */