diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-12-07 18:45:10 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-12-07 18:45:10 +1000 |
commit | 32fa23aaf24a437f8faa258f7f65507e58b73658 (patch) | |
tree | 0dc16d516b406a49921bf49d524b27866feacd8c | |
parent | 2574105cd5908c0257dc8f2b29a1a33fac5ccb19 (diff) | |
download | crawl-ref-32fa23aaf24a437f8faa258f7f65507e58b73658.tar.gz crawl-ref-32fa23aaf24a437f8faa258f7f65507e58b73658.zip |
Fix another possible instance of NUM_TRAPS.
-rw-r--r-- | crawl-ref/source/dungeon.cc | 5 |
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; } } |