summaryrefslogtreecommitdiff
path: root/src/gui/models/shopitems.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/models/shopitems.cpp')
-rw-r--r--src/gui/models/shopitems.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/models/shopitems.cpp b/src/gui/models/shopitems.cpp
index 94bba3be4..a5c05388b 100644
--- a/src/gui/models/shopitems.cpp
+++ b/src/gui/models/shopitems.cpp
@@ -46,7 +46,7 @@ ShopItems::~ShopItems()
std::string ShopItems::getElementAt(int i)
{
if (i < 0 || CAST_U32(i)
- >= CAST_U32(mShopItems.size()) || !mShopItems.at(i))
+ >= CAST_U32(mShopItems.size()) || (mShopItems.at(i) == nullptr))
{
return "";
}
@@ -79,7 +79,7 @@ ShopItem *ShopItems::addItemNoDup(const int id,
const int price)
{
ShopItem *item = findItem(id, color);
- if (!item)
+ if (item == nullptr)
{
item = new ShopItem(-1,
id,
@@ -105,7 +105,7 @@ ShopItem *ShopItems::addItem2(const int inventoryIndex,
if (mMergeDuplicates)
item = findItem(id, color);
- if (item)
+ if (item != nullptr)
{
item->addDuplicate(inventoryIndex, quantity);
}
@@ -199,7 +199,7 @@ void ShopItems::updateList()
FOR_EACH (std::vector<ShopItem*>::iterator, it, mAllShopItems)
{
ShopItem *const item = *it;
- if (item && item->isVisible())
+ if ((item != nullptr) && item->isVisible())
mShopItems.push_back(item);
}
}