summaryrefslogtreecommitdiff
path: root/src/spells1.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-09-17 09:58:14 +0200
committerBardur Arantsson <bardur@scientician.net>2016-09-17 09:58:14 +0200
commitcbcc1ba9ddafd8c2480e1c647d4b7b5f630bb63e (patch)
treec61f5f66315c0f5618cf234dca59aa3403417de2 /src/spells1.cc
parent2ec260320655504b88f8042d4b24e3e7910846a7 (diff)
Refactor spellbinder to use std::vector<>
Diffstat (limited to 'src/spells1.cc')
-rw-r--r--src/spells1.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/spells1.cc b/src/spells1.cc
index 9ebec08e..93602d13 100644
--- a/src/spells1.cc
+++ b/src/spells1.cc
@@ -1206,13 +1206,14 @@ void spellbinder_trigger()
auto spellbinder = &p_ptr->spellbinder;
cmsg_print(TERM_L_GREEN, "The spellbinder is triggered!");
- for (int i = 0; i < spellbinder->num; i++)
+
+ for (auto spell_idx: spellbinder->spell_idxs)
{
- msg_format("Triggering spell %s.", spell_type_name(spell_at(spellbinder->spells[i])));
- lua_cast_school_spell(spellbinder->spells[i], TRUE);
+ msg_format("Triggering spell %s.", spell_type_name(spell_at(spell_idx)));
+ lua_cast_school_spell(spell_idx, TRUE);
}
- spellbinder->num = 0;
+ spellbinder->spell_idxs.clear();
spellbinder->trigger = 0;
}