summaryrefslogtreecommitdiff
path: root/src/spellmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-16 20:39:21 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-16 20:39:21 +0300
commitdb82bf99bbd6d246f3e8da19fe88705f7015f144 (patch)
tree3fdd7e569c428b611ddaa80f59ff93da4ade1ed0 /src/spellmanager.cpp
parent11000f010f19a2de85ba26660b451c7c41ab3a97 (diff)
downloadmv-db82bf99bbd6d246f3e8da19fe88705f7015f144.tar.gz
mv-db82bf99bbd6d246f3e8da19fe88705f7015f144.tar.bz2
mv-db82bf99bbd6d246f3e8da19fe88705f7015f144.tar.xz
mv-db82bf99bbd6d246f3e8da19fe88705f7015f144.zip
Move TextCommandType enum into separate file and convert to strong typed.
Diffstat (limited to 'src/spellmanager.cpp')
-rw-r--r--src/spellmanager.cpp7
1 files changed, 4 insertions, 3 deletions
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<int>(MagicSchool::SkillMagic))
>= static_cast<signed>(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<TextCommandType>(commandType) == TEXT_COMMAND_MAGIC)
+ if (static_cast<TextCommandType>(commandType) ==
+ TextCommandType::Magic)
{
addSpell(new TextCommand(i, symbol, cmd, comment,
static_cast<CommandTargetT>(targetType), icon, basicLvl,