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/gui/shortcut/dropshortcut.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/gui/shortcut/dropshortcut.cpp')
-rw-r--r-- | src/gui/shortcut/dropshortcut.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/shortcut/dropshortcut.cpp b/src/gui/shortcut/dropshortcut.cpp index 1afea70ec..f9876ebee 100644 --- a/src/gui/shortcut/dropshortcut.cpp +++ b/src/gui/shortcut/dropshortcut.cpp @@ -53,7 +53,7 @@ DropShortcut::~DropShortcut() void DropShortcut::dropFirst() const { - if (!localPlayer) + if (localPlayer == nullptr) return; if (!PacketLimiter::limitPackets(PacketType::PACKET_DROP)) @@ -68,7 +68,7 @@ void DropShortcut::dropFirst() const { const Item *const item = PlayerInfo::getInventory() ->findItem(itemId, itemColor); - if (item && item->getQuantity()) + if ((item != nullptr) && (item->getQuantity() != 0)) { const int cnt = settings.quickDropCounter; if (localPlayer->isServerBuggy()) @@ -86,7 +86,7 @@ void DropShortcut::dropFirst() const void DropShortcut::dropItems(const int cnt) { - if (!localPlayer) + if (localPlayer == nullptr) return; if (localPlayer->isServerBuggy()) @@ -114,7 +114,7 @@ void DropShortcut::dropItems(const int cnt) bool DropShortcut::dropItem(const int cnt) { const Inventory *const inv = PlayerInfo::getInventory(); - if (!inv) + if (inv == nullptr) return false; int itemId = 0; @@ -133,7 +133,7 @@ bool DropShortcut::dropItem(const int cnt) if (itemId > 0) { const Item *const item = inv->findItem(itemId, itemColor); - if (item && + if ((item != nullptr) && item->getQuantity() > 0) { PlayerInfo::dropItem(item, cnt, Sfx_true); @@ -158,7 +158,7 @@ bool DropShortcut::dropItem(const int cnt) if (itemId > 0) { const Item *const item = inv->findItem(itemId, itemColor); - if (item && item->getQuantity() > 0) + if ((item != nullptr) && item->getQuantity() > 0) { PlayerInfo::dropItem(item, cnt, Sfx_true); return true; |