diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-06 23:34:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-07 19:23:40 +0300 |
commit | 36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch) | |
tree | 190156cb88b13a38a6d13c69ee0742cc078065a1 /src/resources/db/emotedb.cpp | |
parent | f1518dd8476c968a43fa57cfb06198e290a4f77a (diff) | |
download | manaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz manaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2 manaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz manaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip |
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/resources/db/emotedb.cpp')
-rw-r--r-- | src/resources/db/emotedb.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/resources/db/emotedb.cpp b/src/resources/db/emotedb.cpp index 7d9e47e8b..085f81abe 100644 --- a/src/resources/db/emotedb.cpp +++ b/src/resources/db/emotedb.cpp @@ -75,7 +75,7 @@ void EmoteDB::loadXmlFile(const std::string &fileName, XML::Document doc(fileName, UseVirtFs_true, skipError); XmlNodePtrConst rootNode = doc.rootNode(); - if (!rootNode || !xmlNameEqual(rootNode, "emotes")) + if ((rootNode == nullptr) || !xmlNameEqual(rootNode, "emotes")) { logger->log("Emote Database: Error while loading %s!", fileName.c_str()); @@ -113,7 +113,7 @@ void EmoteDB::loadXmlFile(const std::string &fileName, currentInfo = mEmoteInfos[id]; else currentInfo = new EmoteInfo; - if (!currentInfo) + if (currentInfo == nullptr) continue; currentInfo->time = XML::getProperty(emoteNode, "time", 500); currentInfo->effectId = XML::getProperty(emoteNode, "effect", -1); @@ -152,7 +152,7 @@ void EmoteDB::loadSpecialXmlFile(const std::string &fileName, XML::Document doc(fileName, UseVirtFs_true, skipError); XmlNodePtrConst rootNode = doc.rootNode(); - if (!rootNode || !xmlNameEqual(rootNode, "emotes")) + if ((rootNode == nullptr) || !xmlNameEqual(rootNode, "emotes")) { logger->log1("Emote Database: Error while loading" " manaplus_emotes.xml!"); @@ -186,7 +186,7 @@ void EmoteDB::loadSpecialXmlFile(const std::string &fileName, EmoteInfo *currentInfo = nullptr; if (mEmoteInfos.find(id) != mEmoteInfos.end()) currentInfo = mEmoteInfos[id]; - if (!currentInfo) + if (currentInfo == nullptr) currentInfo = new EmoteInfo; currentInfo->time = XML::getProperty(emoteNode, "time", 500); currentInfo->effectId = XML::getProperty(emoteNode, "effect", -1); @@ -226,7 +226,7 @@ void EmoteDB::unload() { FOR_EACH (EmoteInfos::const_iterator, i, mEmoteInfos) { - if (i->second) + if (i->second != nullptr) { std::list<EmoteSprite*> &sprites = i->second->sprites; while (!sprites.empty()) @@ -295,7 +295,7 @@ const EmoteInfo *EmoteDB::get2(int id, const bool allowNull) const EmoteSprite *EmoteDB::getSprite(const int id, const bool allowNull) { const EmoteInfo *const info = get(id, allowNull); - if (!info) + if (info == nullptr) return nullptr; return info->sprites.front(); |