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/item/item.cpp | |
parent | f1518dd8476c968a43fa57cfb06198e290a4f77a (diff) | |
download | manaplus-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/item/item.cpp')
-rw-r--r-- | src/resources/item/item.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/resources/item/item.cpp b/src/resources/item/item.cpp index c2c25a78c..897340732 100644 --- a/src/resources/item/item.cpp +++ b/src/resources/item/item.cpp @@ -78,7 +78,7 @@ Item::Item(const int id, Item::~Item() { - if (mImage) + if (mImage != nullptr) { mImage->decRef(); mImage = nullptr; @@ -97,7 +97,7 @@ void Item::setId(const int id, mEquipment = fromBool(id && CAST_S32(getInfo().getType()) >= 2, Equipm); - if (mImage) + if (mImage != nullptr) mImage->decRef(); const ItemInfo &info = getInfo(); @@ -108,7 +108,7 @@ void Item::setId(const int id, info.getDyeIconColorsString(color)); mImage = Loader::getImage(dye); - if (!mImage) + if (mImage == nullptr) { mImage = Theme::getImageFromTheme(paths.getValue("unknownItemFile", "unknown-item.png")); @@ -131,7 +131,7 @@ Image *Item::getImage(const int id, "itemIcons"), info.getDisplay().image), info.getDyeIconColorsString(color))); - if (!image) + if (image == nullptr) image = Theme::getImageFromTheme("unknown-item.png"); return image; } @@ -167,7 +167,7 @@ int Item::getCard(const int index) const void Item::setCards(const int *const cards, const int size) { - if (size < 0 || !cards) + if (size < 0 || (cards == nullptr)) return; int sz = size; if (sz > maxCards) @@ -180,7 +180,7 @@ void Item::addCard(const int card) { for (int f = 0; f < maxCards; f ++) { - if (!mCards[f]) + if (mCards[f] == 0) { mCards[f] = card; return; |