From bc05e688174d24f3b2b01ee0ab5ce73787817832 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 18 Jun 2018 04:13:26 +0300 Subject: Fix some style issues after automatic checks. --- src/net/eathena/npchandler.cpp | 2 +- src/net/tmwa/npchandler.cpp | 3 +-- src/progs/manaplus/client.cpp | 2 +- src/resources/db/groupdb.cpp | 2 -- src/resources/mapreader.cpp | 6 +++--- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp index 7ec80433a..9a0054b6a 100644 --- a/src/net/eathena/npchandler.cpp +++ b/src/net/eathena/npchandler.cpp @@ -327,10 +327,10 @@ BeingId NpcHandler::getNpc(Net::MessageIn &msg, const BeingId npcId = msg.readBeingId("npc id"); const NpcDialogs::const_iterator diag = NpcDialog::mNpcDialogs.find(npcId); - Ea::NpcRecv::mDialog = nullptr; if (diag == NpcDialog::mNpcDialogs.end()) { + Ea::NpcRecv::mDialog = nullptr; // Empty dialogs don't help if (action == NpcAction::Close) { diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index c577bc6a1..df9f40219 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -206,11 +206,10 @@ BeingId NpcHandler::getNpc(Net::MessageIn &msg, const BeingId npcId = msg.readBeingId("npc id"); const NpcDialogs::const_iterator diag = NpcDialog::mNpcDialogs.find(npcId); - Ea::NpcRecv::mDialog = nullptr; if (diag == NpcDialog::mNpcDialogs.end()) { - // +++ must be removed packet id checks from here + Ea::NpcRecv::mDialog = nullptr; // Empty dialogs don't help if (action == NpcAction::Close) { diff --git a/src/progs/manaplus/client.cpp b/src/progs/manaplus/client.cpp index 22d2bc483..f9f608102 100644 --- a/src/progs/manaplus/client.cpp +++ b/src/progs/manaplus/client.cpp @@ -304,7 +304,7 @@ void Client::gameInit() #ifndef ENABLE_COMMANDLINEPASSWORD if (!settings.options.password.empty()) { - settings.options.password = std::string(); + settings.options.password.clear(); logger->log("Command line password parameter disabled."); } #endif diff --git a/src/resources/db/groupdb.cpp b/src/resources/db/groupdb.cpp index 1102b7ec4..a8b75d39f 100644 --- a/src/resources/db/groupdb.cpp +++ b/src/resources/db/groupdb.cpp @@ -410,8 +410,6 @@ bool GroupDb::isAllowCommand(const ServerCommandTypeT command) { const int groupId = localPlayer->getGroupId(); const GroupInfo *const group = GroupDb::getGroup(groupId); - if (group == nullptr) - return false; #ifdef TMWA_SUPPORT // allow any commands for legacy if group > 0 diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 9393e781b..74059a034 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -1120,11 +1120,11 @@ Tileset *MapReader::readTileset(XmlNodePtr node, const std::string source = XML::getProperty( childNode, "source", ""); - const std::string sourceResolved = resolveRelativePath(pathDir, - source); - if (!source.empty()) { + const std::string sourceResolved = resolveRelativePath(pathDir, + source); + Image *const tilebmp = Loader::getImage(sourceResolved); if (tilebmp != nullptr) -- cgit v1.2.3-70-g09d2