Skip to content

Commit

Permalink
fix: sonar (improve readability)
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Nov 13, 2024
1 parent 0cae46b commit 174736d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1523,8 +1523,8 @@ void ProtocolGame::checkCreatureAsKnown(uint32_t id, bool &known, uint32_t &remo
}
// We need to protect party players from removing
const auto &creature = g_game().getCreatureByID(*it);
if (std::shared_ptr<Player> checkPlayer;
creature && (checkPlayer = creature->getPlayer()) != nullptr) {
const auto &checkPlayer = creature ? creature->getPlayer() : nullptr;
if (checkPlayer) {
if (player->getParty() != checkPlayer->getParty() && !canSee(creature)) {
removedKnown = *it;
knownCreatureSet.erase(it);
Expand Down

0 comments on commit 174736d

Please sign in to comment.