summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r--crawl-ref/source/dungeon.cc4
1 files changed, 3 insertions, 1 deletions
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!