summaryrefslogtreecommitdiff
path: root/src/resources/inventory/complexinventory.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-06 23:34:34 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-07 19:23:40 +0300
commit36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch)
tree190156cb88b13a38a6d13c69ee0742cc078065a1 /src/resources/inventory/complexinventory.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadmanaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz
manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2
manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz
manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/resources/inventory/complexinventory.cpp')
-rw-r--r--src/resources/inventory/complexinventory.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/resources/inventory/complexinventory.cpp b/src/resources/inventory/complexinventory.cpp
index 82490ac8b..065b77e49 100644
--- a/src/resources/inventory/complexinventory.cpp
+++ b/src/resources/inventory/complexinventory.cpp
@@ -44,7 +44,7 @@ bool ComplexInventory::addVirtualItem(const Item *const item,
int index,
const int amount)
{
- if (!item || PlayerInfo::isItemProtected(item->getId()))
+ if ((item == nullptr) || PlayerInfo::isItemProtected(item->getId()))
return false;
if (index >= 0 && index < CAST_S32(mSize))
@@ -59,7 +59,7 @@ bool ComplexInventory::addVirtualItem(const Item *const item,
return false;
}
citem = dynamic_cast<ComplexItem*>(mItems[index]);
- if (!citem)
+ if (citem == nullptr)
{ // if in inventory not complex item, converting it to complex
citem = new ComplexItem(item2->getId(),
item2->getType(),
@@ -109,7 +109,7 @@ bool ComplexInventory::addVirtualItem(const Item *const item,
return false;
Item *const item2 = getItem(index);
- if (item2)
+ if (item2 != nullptr)
item2->setTag(item->getInvIndex());
return true;
}
@@ -133,7 +133,7 @@ void ComplexInventory::setItem(const int index,
}
const Item *const item1 = mItems[index];
- if (!item1 && id > 0)
+ if ((item1 == nullptr) && id > 0)
{
ComplexItem *const item = new ComplexItem(id,
type,