summaryrefslogtreecommitdiff
path: root/src/melee2.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-10-16 12:28:53 +0200
committerBardur Arantsson <bardur@scientician.net>2016-10-16 12:28:53 +0200
commit128b467fcc9a36fc1f8d1794f8c66ae1a9d08274 (patch)
treeec38cf83c77a0451eaf5d586212f7eca3e23a88c /src/melee2.cc
parente50b345d5c7371432ea29b121edef970e74f7f64 (diff)
Fix monster spell selection caused by 'missing' TRAPS spell
Diffstat (limited to 'src/melee2.cc')
-rw-r--r--src/melee2.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/melee2.cc b/src/melee2.cc
index 0988d2af..fbc793bd 100644
--- a/src/melee2.cc
+++ b/src/melee2.cc
@@ -941,11 +941,11 @@ static std::vector<monster_spell const *> extract_spells(monster_spell_flag_set
auto result = std::vector<monster_spell const *>();
result.reserve(spell_flag_set.nbits);
- for (std::size_t k = 0; k < monster_spell_flag_set::nbits; k++)
+ for (auto const &monster_spell: monster_spells())
{
- if (spell_flag_set.bit(k))
+ if (bool(spell_flag_set & monster_spell->flag_set))
{
- result.push_back(monster_spells()[k]);
+ result.push_back(monster_spell);
}
}