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/tmwa/charserverrecv.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/net/tmwa/charserverrecv.cpp') 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); - 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; -- cgit v1.2.3-70-g09d2