summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2011-02-08 21:49:39 +0000
committersmatz <smatz@openttd.org>2011-02-08 21:49:39 +0000
commit5ccf5cc55174cea36354cd8c67eac88d4839d2d1 (patch)
tree9737e77965b883f09b2dd6c25e15ca7e12ceee5a /src
parent05a846a574e277adf8beb2ab5e021fe49f1f7fc9 (diff)
downloadopenttd-5ccf5cc55174cea36354cd8c67eac88d4839d2d1.tar.xz
(svn r22033) -Fix: don't crash when there are too many objects generated already when placing transmitters
Diffstat (limited to 'src')
-rw-r--r--src/object_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp
index f39700df2..6603ed1bc 100644
--- a/src/object_cmd.cpp
+++ b/src/object_cmd.cpp
@@ -619,7 +619,7 @@ void GenerateObjects()
SetGeneratingWorldProgress(GWP_OBJECT, radiotower_to_build + lighthouses_to_build);
- for (uint i = ScaleByMapSize(1000); i != 0; i--) {
+ for (uint i = ScaleByMapSize(1000); i != 0 && Object::CanAllocateItem(); i--) {
TileIndex tile = RandomTile();
uint h;