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/net/tmwa/npchandler.cpp | |
parent | f1518dd8476c968a43fa57cfb06198e290a4f77a (diff) | |
download | plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2 plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip |
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/net/tmwa/npchandler.cpp')
-rw-r--r-- | src/net/tmwa/npchandler.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index 898e9fff4..0c0b13116 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -52,7 +52,7 @@ NpcHandler::NpcHandler() : void NpcHandler::talk(const Being *const being) const { - if (!being) + if (being == nullptr) return; createOutPacket(CMSG_NPC_TALK); outMsg.writeBeingId(being->getId(), "npc id"); @@ -74,7 +74,7 @@ void NpcHandler::closeDialog(const BeingId npcId) if (it != NpcDialog::mNpcDialogs.end()) { NpcDialog *const dialog = (*it).second; - if (dialog) + if (dialog != nullptr) dialog->close(); if (dialog == Ea::NpcRecv::mDialog) Ea::NpcRecv::mDialog = nullptr; @@ -110,7 +110,7 @@ void NpcHandler::stringInput(const BeingId npcId, void NpcHandler::buy(const Being *const being) const { - if (!being) + if (being == nullptr) return; createOutPacket(CMSG_NPC_BUY_SELL_REQUEST); outMsg.writeBeingId(being->getId(), "npc id"); @@ -223,7 +223,7 @@ BeingId NpcHandler::getNpc(Net::MessageIn &msg, { CREATEWIDGETV(Ea::NpcRecv::mDialog, NpcDialog, npcId); Ea::NpcRecv::mDialog->saveCamera(); - if (localPlayer) + if (localPlayer != nullptr) localPlayer->stopWalking(false); NpcDialog::mNpcDialogs[npcId] = Ea::NpcRecv::mDialog; } @@ -231,10 +231,10 @@ BeingId NpcHandler::getNpc(Net::MessageIn &msg, else { NpcDialog *const dialog = diag->second; - if (Ea::NpcRecv::mDialog && Ea::NpcRecv::mDialog != dialog) + if (Ea::NpcRecv::mDialog != nullptr && Ea::NpcRecv::mDialog != dialog) Ea::NpcRecv::mDialog->restoreCamera(); Ea::NpcRecv::mDialog = dialog; - if (Ea::NpcRecv::mDialog) + if (Ea::NpcRecv::mDialog != nullptr) Ea::NpcRecv::mDialog->saveCamera(); } return npcId; |