summaryrefslogtreecommitdiff
path: root/src/net/tmwa/playerhandler.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/net/tmwa/playerhandler.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadmanaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz
manaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2
manaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz
manaverse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/net/tmwa/playerhandler.cpp')
-rw-r--r--src/net/tmwa/playerhandler.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index d9ec46fe3..66bd1a037 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -99,14 +99,14 @@ 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);
outMsg.writeBeingId(floorItem->getId(), "object id");
TmwAthena::InventoryHandler *const handler =
static_cast<TmwAthena::InventoryHandler*>(inventoryHandler);
- if (handler)
+ if (handler != nullptr)
handler->pushPickup(floorItem->getId());
}
@@ -245,11 +245,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(
@@ -260,11 +260,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);
@@ -282,7 +282,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();
@@ -290,7 +290,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: