summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stairs.cc
diff options
context:
space:
mode:
authorEduardo Gonzalez <ed.gonzalez3@gmail.com>2014-05-07 01:14:01 -0700
committerreaverb <reaverb.Crawl@gmail.com>2014-05-09 12:44:03 -0400
commitf2248c4d6d8cff0e089f7a57ff6b56ad374f1117 (patch)
treec99937e797518f99096ca458489f429c140f9445 /crawl-ref/source/stairs.cc
parent200594107ff01983471285d40ba187b105635a69 (diff)
downloadcrawl-ref-f2248c4d6d8cff0e089f7a57ff6b56ad374f1117.tar.gz
crawl-ref-f2248c4d6d8cff0e089f7a57ff6b56ad374f1117.zip
Expose bitset's count function through FixedBitVector...
and use it to speed up counting runes in a few places. Vaults and Zot entrances report activated runes by name, so weren't updated.
Diffstat (limited to 'crawl-ref/source/stairs.cc')
-rw-r--r--crawl-ref/source/stairs.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/crawl-ref/source/stairs.cc b/crawl-ref/source/stairs.cc
index a5dc223636..f34968d02d 100644
--- a/crawl-ref/source/stairs.cc
+++ b/crawl-ref/source/stairs.cc
@@ -806,11 +806,7 @@ void down_stairs(dungeon_feature_type force_stair, bool force_known_shaft)
if (stair_find == DNGN_ENTER_ZIGGURAT)
{
#define ZIG_RUNES 3
- int nrune = 0;
- for (int i = 0; i < NUM_RUNE_TYPES; i++)
- if (you.runes[i])
- nrune++;
- if (nrune < ZIG_RUNES)
+ if (runes_in_pack() < ZIG_RUNES)
{
mprf("You need at least %d runes to enter this place.", ZIG_RUNES);
return;