diff options
author | Eduardo Gonzalez <ed.gonzalez3@gmail.com> | 2014-05-07 01:14:01 -0700 |
---|---|---|
committer | reaverb <reaverb.Crawl@gmail.com> | 2014-05-09 12:44:03 -0400 |
commit | f2248c4d6d8cff0e089f7a57ff6b56ad374f1117 (patch) | |
tree | c99937e797518f99096ca458489f429c140f9445 /crawl-ref/source/stairs.cc | |
parent | 200594107ff01983471285d40ba187b105635a69 (diff) | |
download | crawl-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.cc | 6 |
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; |