From 36ba43d6ea38062b17f7e63ef659962bfc51c64d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 6 Jun 2017 23:34:34 +0300 Subject: Fix clang-tidy check readability-implicit-bool-cast. --- src/net/eathena/inventoryhandler.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/net/eathena/inventoryhandler.cpp') diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index a7fde5a05..6a5152fad 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -80,7 +80,7 @@ InventoryHandler::~InventoryHandler() void InventoryHandler::equipItem(const Item *const item) const { - if (!item) + if (item == nullptr) return; createOutPacket(CMSG_PLAYER_EQUIP); @@ -96,7 +96,7 @@ void InventoryHandler::equipItem(const Item *const item) const void InventoryHandler::unequipItem(const Item *const item) const { - if (!item) + if (item == nullptr) return; createOutPacket(CMSG_PLAYER_UNEQUIP); @@ -106,7 +106,7 @@ void InventoryHandler::unequipItem(const Item *const item) const void InventoryHandler::useItem(const Item *const item) const { - if (!item) + if (item == nullptr) return; createOutPacket(CMSG_PLAYER_INVENTORY_USE); @@ -117,7 +117,7 @@ void InventoryHandler::useItem(const Item *const item) const void InventoryHandler::dropItem(const Item *const item, const int amount) const { - if (!item) + if (item == nullptr) return; createOutPacket(CMSG_PLAYER_INVENTORY_DROP); @@ -477,7 +477,7 @@ void InventoryHandler::moveItem2(const InventoryTypeT source, } // for packetVersion < 20101124 need use other packet offset - if (packet) + if (packet != 0) { createOutPacket(packet); outMsg.writeInt16(CAST_S16(slot + offset), "index"); @@ -487,7 +487,7 @@ void InventoryHandler::moveItem2(const InventoryTypeT source, void InventoryHandler::useCard(const Item *const item) { - if (!item) + if (item == nullptr) return; mItemIndex = item->getInvIndex(); @@ -509,7 +509,7 @@ void InventoryHandler::insertCard(const int cardIndex, void InventoryHandler::favoriteItem(const Item *const item, const bool favorite) const { - if (!item) + if (item == nullptr) return; if (packetVersion < 20120410) return; @@ -517,12 +517,12 @@ void InventoryHandler::favoriteItem(const Item *const item, outMsg.writeInt16(CAST_S16(item->getInvIndex() + INVENTORY_OFFSET), "item index"); - outMsg.writeInt8(favorite, "favorite flag"); + outMsg.writeInt8(static_cast(favorite), "favorite flag"); } void InventoryHandler::selectEgg(const Item *const item) const { - if (!item) + if (item == nullptr) return; createOutPacket(CMSG_PET_SELECT_EGG); outMsg.writeInt16(CAST_S16( -- cgit v1.2.3-70-g09d2