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/net/tmwa/charserverrecv.cpp | |
parent | f1518dd8476c968a43fa57cfb06198e290a4f77a (diff) | |
download | manaverse-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/charserverrecv.cpp')
-rw-r--r-- | src/net/tmwa/charserverrecv.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/net/tmwa/charserverrecv.cpp b/src/net/tmwa/charserverrecv.cpp index 43f405542..571ce0b3b 100644 --- a/src/net/tmwa/charserverrecv.cpp +++ b/src/net/tmwa/charserverrecv.cpp @@ -64,7 +64,7 @@ extern ServerInfo charServer; void CharServerRecv::readPlayerData(Net::MessageIn &msg, Net::Character *const character) { - if (!character) + if (character == nullptr) return; const Token &token = @@ -193,7 +193,7 @@ void CharServerRecv::processCharLogin(Net::MessageIn &msg) Net::Character *const character = new Net::Character; readPlayerData(msg, character); charServerHandler->mCharacters.push_back(character); - if (character->dummy) + if (character->dummy != nullptr) { logger->log("CharServer: Player: %s (%d)", character->dummy->getName().c_str(), character->slot); @@ -232,7 +232,7 @@ void CharServerRecv::processCharMapInfo(Net::MessageIn &restrict msg) charServerHandler->clear(); charServerHandler->updateCharSelectDialog(); - if (network) + if (network != nullptr) network->disconnect(); client->setState(State::CONNECT_GAME); BLOCK_END("CharServerRecv::processCharMapInfo") @@ -244,7 +244,7 @@ void CharServerRecv::processChangeMapServer(Net::MessageIn &msg) ServerInfo &server = mapServer; BLOCK_START("CharServerRecv::processChangeMapServer") GameHandler *const gh = static_cast<GameHandler*>(gameHandler); - if (!gh || !network) + if ((gh == nullptr) || (network == nullptr)) { BLOCK_END("CharServerRecv::processChangeMapServer") return; @@ -265,7 +265,7 @@ void CharServerRecv::processChangeMapServer(Net::MessageIn &msg) network->disconnect(); client->setState(State::CHANGE_MAP); - if (localPlayer) + if (localPlayer != nullptr) { localPlayer->setTileCoords(x, y); localPlayer->setMap(nullptr); @@ -283,7 +283,7 @@ void CharServerRecv::processCharCreate(Net::MessageIn &msg) charServerHandler->updateCharSelectDialog(); // Close the character create dialog - if (charServerHandler->mCharCreateDialog) + if (charServerHandler->mCharCreateDialog != nullptr) { charServerHandler->mCharCreateDialog->scheduleDelete(); charServerHandler->mCharCreateDialog = nullptr; |