summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-12-07 18:45:10 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-12-07 18:45:10 +1000
commit32fa23aaf24a437f8faa258f7f65507e58b73658 (patch)
tree0dc16d516b406a49921bf49d524b27866feacd8c /crawl-ref/source/dungeon.cc
parent2574105cd5908c0257dc8f2b29a1a33fac5ccb19 (diff)
downloadcrawl-ref-32fa23aaf24a437f8faa258f7f65507e58b73658.tar.gz
crawl-ref-32fa23aaf24a437f8faa258f7f65507e58b73658.zip
Fix another possible instance of NUM_TRAPS.
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r--crawl-ref/source/dungeon.cc5
1 files changed, 3 insertions, 2 deletions
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;
}
}