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/playerhandler.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/net/eathena/playerhandler.cpp') diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index 818fffde9..ef7afa6e4 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -101,7 +101,7 @@ void PlayerHandler::increaseSkill(const uint16_t skillId) const void PlayerHandler::pickUp(const FloorItem *const floorItem) const { - if (!floorItem) + if (floorItem == nullptr) return; createOutPacket(CMSG_ITEM_PICKUP); @@ -203,7 +203,7 @@ void PlayerHandler::pickUp(const FloorItem *const floorItem) const EAthena::InventoryHandler *const handler = static_cast(inventoryHandler); - if (handler) + if (handler != nullptr) handler->pushPickup(floorItem->getId()); } @@ -543,11 +543,11 @@ void PlayerHandler::setStat(Net::MessageIn &msg, break; case Sp::HP: PlayerInfo::setAttribute(Attributes::PLAYER_HP, base); - if (localPlayer->isInParty() && Party::getParty(1)) + if (localPlayer->isInParty() && (Party::getParty(1) != nullptr)) { PartyMember *const m = Party::getParty(1) ->getMember(localPlayer->getId()); - if (m) + if (m != nullptr) { m->setHp(base); m->setMaxHp(PlayerInfo::getAttribute( @@ -558,11 +558,11 @@ void PlayerHandler::setStat(Net::MessageIn &msg, case Sp::MAXHP: PlayerInfo::setAttribute(Attributes::PLAYER_MAX_HP, base); - if (localPlayer->isInParty() && Party::getParty(1)) + if (localPlayer->isInParty() && (Party::getParty(1) != nullptr)) { PartyMember *const m = Party::getParty(1)->getMember( localPlayer->getId()); - if (m) + if (m != nullptr) { m->setHp(PlayerInfo::getAttribute(Attributes::PLAYER_HP)); m->setMaxHp(base); @@ -580,7 +580,7 @@ void PlayerHandler::setStat(Net::MessageIn &msg, break; case Sp::BASELEVEL: PlayerInfo::setAttribute(Attributes::PLAYER_LEVEL, base); - if (localPlayer) + if (localPlayer != nullptr) { localPlayer->setLevel(base); localPlayer->updateName(); @@ -588,7 +588,7 @@ void PlayerHandler::setStat(Net::MessageIn &msg, break; case Sp::SKILLPOINT: PlayerInfo::setAttribute(Attributes::PLAYER_SKILL_POINTS, base); - if (skillDialog) + if (skillDialog != nullptr) skillDialog->update(); break; case Sp::STR: -- cgit v1.2.3-70-g09d2