summaryrefslogtreecommitdiff
path: root/src/spellmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-08 23:02:06 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-08 23:02:06 +0300
commit7e66a4606bb15d98197f71245fe191d03152ee5f (patch)
tree825022571cfb55d70f1ca3c142f79db3758fb72b /src/spellmanager.cpp
parenta61ac4664d55cddb18d2d861e76629bd07676129 (diff)
downloadManaVerse-7e66a4606bb15d98197f71245fe191d03152ee5f.tar.gz
ManaVerse-7e66a4606bb15d98197f71245fe191d03152ee5f.tar.bz2
ManaVerse-7e66a4606bb15d98197f71245fe191d03152ee5f.tar.xz
ManaVerse-7e66a4606bb15d98197f71245fe191d03152ee5f.zip
Improve some empty string checks.
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 07ee344f7..e894ff6df 100644
--- a/src/spellmanager.cpp
+++ b/src/spellmanager.cpp
@@ -261,7 +261,7 @@ void SpellManager::load(const bool oldConfig)
mSpells.clear();
mSpellsVector.clear();
- if (cfg->getValue("commandShortcutFlags0", "") == "")
+ if (cfg->getValue("commandShortcutFlags0", "").empty())
{
fillSpells();
save();
@@ -315,7 +315,7 @@ void SpellManager::load(const bool oldConfig)
#define setOrDel(str, method) \
const std::string var##method = spell->method(); \
- if (var##method != "") \
+ if (!var##method.empty()) \
serverConfig.setValue(str + toString(i), var##method); \
else \
serverConfig.deleteKey(str + toString(i));
@@ -331,7 +331,8 @@ void SpellManager::save() const
setOrDel("commandShortcutComment", getComment);
setOrDel("commandShortcutSymbol", getSymbol);
setOrDel("commandShortcutIcon", getIcon);
- if (spell->getCommand() != "" && spell->getSymbol() != "")
+ if (!spell->getCommand().empty() &&
+ !spell->getSymbol().empty())
{
#ifdef TMWA_SUPPORT
serverConfig.setValue("commandShortcutFlags" + toString(i),