summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-12-07 16:40:00 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-12-07 16:40:00 +1000
commit57748b3e59f7e707bbd6420d9b07634ebee53d6e (patch)
tree2c48875adc5329ebbce2377e3a9b527e3ef9afa5 /crawl-ref/source/dungeon.cc
parent1161d234624340e15f6f4ae03a93370d7f8e1913 (diff)
downloadcrawl-ref-57748b3e59f7e707bbd6420d9b07634ebee53d6e.tar.gz
crawl-ref-57748b3e59f7e707bbd6420d9b07634ebee53d6e.zip
Fix unique placement code (doy).
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r--crawl-ref/source/dungeon.cc7
1 files changed, 1 insertions, 6 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index bf7b6a756f..4c244a8939 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -3613,15 +3613,10 @@ static int _place_uniques(int level_number, char level_type)
// placed or available. Then there is a chance of uniques_available /
// B; this only triggers on levels that have less than B uniques to be
// placed.
- float this_chance = float(random2(100)) / 100.0;
-
std::vector<map_def> uniques_available =
find_maps_for_tag("place_unique", true, true);
- float unique_chance = float(std::min(B,
- int(uniques_available.size()))) / float(B);
-
- if (this_chance >= unique_chance)
+ if (random2(B) >= min(B, uniques_available.size()))
break;
const map_def *uniq_map = random_map_for_tag("place_unique", true);