From 32fa23aaf24a437f8faa258f7f65507e58b73658 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Mon, 7 Dec 2009 18:45:10 +1000 Subject: Fix another possible instance of NUM_TRAPS. --- crawl-ref/source/dungeon.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/dungeon.cc') diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index b1acc696be..ab10abb259 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -3172,8 +3172,9 @@ static void _place_traps(int level_number) // Choose again! ts.type = random_trap_for_place(level_number); - // If we get shaft a second time, turn it into an alarm trap. - if (ts.type == TRAP_SHAFT) + // If we get shaft a second time, turn it into an alarm trap, or + // if we got nothing. + if (ts.type == TRAP_SHAFT || ts.type>= NUM_TRAPS) ts.type = TRAP_ALARM; } } -- cgit v1.2.3-54-g00ecf