From 7a14cd46a6ef20eccf81ee4a3842f6d25e53c582 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Mon, 7 Dec 2009 18:30:13 +1000 Subject: Keep trying until we get a valid trap. random_trap_for_place defaults to NUM_TRAPS; none of the functions that it calls currently do, but others might. --- crawl-ref/source/dungeon.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/dungeon.cc') diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index a5be8429f8..b1acc696be 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -3161,7 +3161,9 @@ static void _place_traps(int level_number) if (tries == 200) break; - ts.type = random_trap_for_place(level_number); + while (ts.type >= NUM_TRAPS) + ts.type = random_trap_for_place(level_number); + if (ts.type == TRAP_SHAFT && level_number <= 7) { // Disallow shaft construction in corridors! -- cgit v1.2.3-54-g00ecf