From 17f5fe7521ea045b3ce4bffda708b813359c5ee0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 24 Mar 2013 14:03:12 +0300 Subject: improve spellshortcut class. --- src/spellshortcut.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/spellshortcut.cpp') diff --git a/src/spellshortcut.cpp b/src/spellshortcut.cpp index 533e071a5..5a3dd6eda 100644 --- a/src/spellshortcut.cpp +++ b/src/spellshortcut.cpp @@ -48,18 +48,17 @@ SpellShortcut::~SpellShortcut() void SpellShortcut::load() { - for (unsigned f = 0; f < SPELL_SHORTCUT_ITEMS * SPELL_SHORTCUT_TABS; f ++) + for (unsigned f = 0; f < SPELLS_SIZE; f ++) mItems[f] = -1; if (!spellManager) return; - std::vector spells = spellManager->getAll(); + const std::vector spells = spellManager->getAll(); unsigned k = 0; for (std::vector::const_iterator i = spells.begin(), - i_end = spells.end(); i != i_end - && k < SPELL_SHORTCUT_ITEMS * SPELL_SHORTCUT_TABS; ++i) + i_end = spells.end(); i != i_end && k < SPELLS_SIZE; ++i) { mItems[k++] = (*i)->getId(); } -- cgit v1.2.3-60-g2f50