From b251a923968bed8dddd52d37a0319564ae9f1312 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sat, 5 Dec 2009 17:25:49 +1000 Subject: Fix uniques spawning multiple times (bug #123, Kyrris). dgn_reset_level(), which resets you.unique_creatures, was being called before temp_unique_creatures (where you.unique_creatures was being backed) was actually initialised. --- crawl-ref/source/dungeon.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 8c91a76616..39f599bb2e 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -308,6 +308,11 @@ bool builder(int level_number, int level_type) const std::set uniq_tags = you.uniq_map_tags; const std::set uniq_names = you.uniq_map_names; + // Save a copy of unique creatures for vetoes. + temp_unique_creatures = you.unique_creatures; + // And unrands + temp_unique_items = you.unique_items; + unwind_bool levelgen(Generating_Level, true); // N tries to build the level, after which we bail with a capital B. @@ -1831,11 +1836,6 @@ static void _build_dungeon_level(int level_number, int level_type) return; } - // Save a copy of unique creatures in case we get vetoed. - temp_unique_creatures = you.unique_creatures; - // And unrands - temp_unique_items = you.unique_items; - // Try to place minivaults that really badly want to be placed. Still // no guarantees, seeing this is a minivault. _place_minivaults(); -- cgit v1.2.3-54-g00ecf