summaryrefslogtreecommitdiff
path: root/src/net/eathena/guildhandler.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/eathena/guildhandler.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadmv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz
mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2
mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz
mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/net/eathena/guildhandler.cpp')
-rw-r--r--src/net/eathena/guildhandler.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp
index 3ea95b438..f2c90e874 100644
--- a/src/net/eathena/guildhandler.cpp
+++ b/src/net/eathena/guildhandler.cpp
@@ -75,12 +75,12 @@ void GuildHandler::create(const std::string &name) const
void GuildHandler::invite(const std::string &name) const
{
- if (!actorManager)
+ if (actorManager == nullptr)
return;
const Being *const being = actorManager->findBeingByName(
name, ActorType::Player);
- if (being)
+ if (being != nullptr)
{
createOutPacket(CMSG_GUILD_INVITE);
outMsg.writeBeingId(being->getId(), "account id");
@@ -96,7 +96,7 @@ void GuildHandler::invite(const std::string &name) const
void GuildHandler::invite(const Being *const being) const
{
- if (!being)
+ if (being == nullptr)
return;
createOutPacket(CMSG_GUILD_INVITE);
@@ -110,14 +110,14 @@ void GuildHandler::inviteResponse(const int guildId,
{
createOutPacket(CMSG_GUILD_INVITE_REPLY);
outMsg.writeInt32(guildId, "guild id");
- outMsg.writeInt8(response, "response");
+ outMsg.writeInt8(static_cast<int8_t>(response), "response");
outMsg.writeInt8(0, "unused");
outMsg.writeInt16(0, "unused");
}
void GuildHandler::leave(const int guildId) const
{
- if (!localPlayer)
+ if (localPlayer == nullptr)
return;
createOutPacket(CMSG_GUILD_LEAVE);
@@ -130,7 +130,7 @@ void GuildHandler::leave(const int guildId) const
void GuildHandler::kick(const GuildMember *restrict const member,
const std::string &restrict reason) const
{
- if (!member || !member->getGuild())
+ if ((member == nullptr) || (member->getGuild() == nullptr))
return;
createOutPacket(CMSG_GUILD_EXPULSION);
@@ -142,7 +142,7 @@ void GuildHandler::kick(const GuildMember *restrict const member,
void GuildHandler::chat(const std::string &text) const
{
- if (!localPlayer)
+ if (localPlayer == nullptr)
return;
const std::string str = std::string(localPlayer->getName()).append(
@@ -189,7 +189,7 @@ void GuildHandler::info() const
void GuildHandler::changeMemberPostion(const GuildMember *const member,
const int level) const
{
- if (!member || !member->getGuild())
+ if ((member == nullptr) || (member->getGuild() == nullptr))
return;
createOutPacket(CMSG_GUILD_CHANGE_MEMBER_POS);
@@ -216,7 +216,7 @@ void GuildHandler::checkMaster() const
void GuildHandler::requestAlliance(const Being *const being) const
{
- if (!being)
+ if (being == nullptr)
return;
createOutPacket(CMSG_GUILD_ALLIANCE_REQUEST);
@@ -230,7 +230,7 @@ void GuildHandler::requestAllianceResponse(const int beingId,
{
createOutPacket(CMSG_GUILD_ALLIANCE_REPLY);
outMsg.writeInt32(beingId, "account id");
- outMsg.writeInt32(accept, "accept flag");
+ outMsg.writeInt32(static_cast<int32_t>(accept), "accept flag");
}
void GuildHandler::endAlliance(const int guildId,
@@ -258,7 +258,7 @@ void GuildHandler::changePostionInfo(const int posId,
void GuildHandler::requestOpposition(const Being *const being) const
{
- if (!being)
+ if (being == nullptr)
return;
createOutPacket(CMSG_GUILD_OPPOSITION);