From db82bf99bbd6d246f3e8da19fe88705f7015f144 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 16 Nov 2015 20:39:21 +0300 Subject: Move TextCommandType enum into separate file and convert to strong typed. --- src/spellmanager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/spellmanager.cpp') diff --git a/src/spellmanager.cpp b/src/spellmanager.cpp index 9409c6c1c..4383f9331 100644 --- a/src/spellmanager.cpp +++ b/src/spellmanager.cpp @@ -134,7 +134,7 @@ void SpellManager::invoke(const int spellId) const if (!playerHandler || spell->getCommand().empty()) return; - if (spell->getCommandType() == TEXT_COMMAND_TEXT + if (spell->getCommandType() == TextCommandType::Text || (playerHandler->canUseMagic() && PlayerInfo::getSkillLevel(static_cast(MagicSchool::SkillMagic)) >= static_cast(spell->getBaseLvl()) @@ -148,7 +148,7 @@ void SpellManager::invoke(const int spellId) const invokeSpell(spell); } if ((target && (target->getType() != ActorType::Monster - || spell->getCommandType() == TEXT_COMMAND_TEXT)) + || spell->getCommandType() == TextCommandType::Text)) && (spell->getTargetType() == CommandTarget::AllowTarget || spell->getTargetType() == CommandTarget::NeedTarget)) { @@ -284,7 +284,8 @@ void SpellManager::load(const bool oldConfig) std::string icon = cfg->getValue("commandShortcutIcon" + toString(i), ""); - if (static_cast(commandType) == TEXT_COMMAND_MAGIC) + if (static_cast(commandType) == + TextCommandType::Magic) { addSpell(new TextCommand(i, symbol, cmd, comment, static_cast(targetType), icon, basicLvl, -- cgit v1.2.3-60-g2f50