diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-28 21:37:36 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-28 21:37:36 +1000 |
commit | 97870b61701d19f36ae6da5b88595f207cb5c173 (patch) | |
tree | 6f7777b55bd8cd27b08bcfe5d9c57749b96c7f3b /crawl-ref/source/dungeon.cc | |
parent | 4c967be2141ad2b6a86395a48b7f02dfc94dff9d (diff) | |
download | crawl-ref-97870b61701d19f36ae6da5b88595f207cb5c173.tar.gz crawl-ref-97870b61701d19f36ae6da5b88595f207cb5c173.zip |
Give unique maps a second and third chance to place.
If the map doesn't get placed, give it a second and third try at it.
Give up after these, though; this means that uniques should probably
generate at the same rate as they were at before.
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r-- | crawl-ref/source/dungeon.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 2b9e5cfd14..b3ade88bf7 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -3595,7 +3595,16 @@ static int _place_uniques(int level_number, char level_type) break; } - if (dgn_place_map(uniq_map, false, false)) + bool map_placed = false; + + for (int i = 0; i <= 3; i++) + { + if (map_placed) + continue; + map_placed = dgn_place_map(uniq_map, false, false); + } + + if (map_placed) { num_placed++; #ifdef DEBUG_UNIQUE_PLACEMENT |