Skip to content

Commit

Permalink
fix smells
Browse files Browse the repository at this point in the history
  • Loading branch information
mehah committed Oct 17, 2023
1 parent aa3d7f2 commit 737298d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/creatures/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ void Creature::setIncreasePercent(CombatType_t combat, int32_t value) {
}
}

const std::vector<std::shared_ptr<Zone>> Creature::getZones() {
std::vector<std::shared_ptr<Zone>> Creature::getZones() {
return Zone::getZones(getPosition());
}

Expand Down
6 changes: 3 additions & 3 deletions src/creatures/creature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class Creature : virtual public Thing, public SharedObject {
return ZONE_NORMAL;
}

const std::vector<std::shared_ptr<Zone>> getZones();
std::vector<std::shared_ptr<Zone>> getZones();

// walk functions
void startAutoWalk(const std::forward_list<Direction> &listDir, bool ignoreConditions = false);
Expand Down Expand Up @@ -331,7 +331,7 @@ class Creature : virtual public Thing, public SharedObject {
return m_master.lock();
}

const auto &getSummons() {
const auto &getSummons() const {
return m_summons;
}

Expand Down Expand Up @@ -459,7 +459,7 @@ class Creature : virtual public Thing, public SharedObject {
return false;
}

size_t getSummonCount() {
size_t getSummonCount() const {
return m_summons.size();
}

Expand Down
3 changes: 1 addition & 2 deletions src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7487,8 +7487,7 @@ void Game::updatePlayerHelpers(std::shared_ptr<Player> player) {
return;
}

uint16_t helpers = player->getHelpers();

const uint16_t helpers = player->getHelpers();
for (const auto &spectator : Spectators().find<Player>(player->getPosition(), true)) {
spectator->getPlayer()->sendCreatureHelpers(player->getID(), helpers);
}
Expand Down
2 changes: 1 addition & 1 deletion src/map/house/house.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ void AccessList::addGuildRank(const std::string &name, const std::string &guildN
}
}

bool AccessList::isInList(std::shared_ptr<Player> player) {
bool AccessList::isInList(std::shared_ptr<Player> player) const {
if (allowEveryone) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/map/house/house.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AccessList {
void addGuild(const std::string &name);
void addGuildRank(const std::string &name, const std::string &rankName);

bool isInList(std::shared_ptr<Player> player);
bool isInList(std::shared_ptr<Player> player) const;

void getList(std::string &list) const;

Expand Down
12 changes: 6 additions & 6 deletions src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5822,7 +5822,7 @@ void ProtocolGame::sendPartyCreatureUpdate(std::shared_ptr<Creature> target) {

void ProtocolGame::sendPartyCreatureShield(std::shared_ptr<Creature> target) {
uint32_t cid = target->getID();
if (knownCreatureSet.find(cid) == knownCreatureSet.end()) {
if (!knownCreatureSet.contains(cid)) {
sendPartyCreatureUpdate(target);
return;
}
Expand All @@ -5840,7 +5840,7 @@ void ProtocolGame::sendPartyCreatureSkull(std::shared_ptr<Creature> target) {
}

uint32_t cid = target->getID();
if (knownCreatureSet.find(cid) == knownCreatureSet.end()) {
if (!knownCreatureSet.contains(cid)) {
sendPartyCreatureUpdate(target);
return;
}
Expand All @@ -5854,7 +5854,7 @@ void ProtocolGame::sendPartyCreatureSkull(std::shared_ptr<Creature> target) {

void ProtocolGame::sendPartyCreatureHealth(std::shared_ptr<Creature> target, uint8_t healthPercent) {
uint32_t cid = target->getID();
if (knownCreatureSet.find(cid) == knownCreatureSet.end()) {
if (!knownCreatureSet.contains(cid)) {
sendPartyCreatureUpdate(target);
return;
}
Expand All @@ -5868,7 +5868,7 @@ void ProtocolGame::sendPartyCreatureHealth(std::shared_ptr<Creature> target, uin

void ProtocolGame::sendPartyPlayerMana(std::shared_ptr<Player> target, uint8_t manaPercent) {
uint32_t cid = target->getID();
if (knownCreatureSet.find(cid) == knownCreatureSet.end()) {
if (!knownCreatureSet.contains(cid)) {
sendPartyCreatureUpdate(target);
}

Expand All @@ -5886,7 +5886,7 @@ void ProtocolGame::sendPartyPlayerMana(std::shared_ptr<Player> target, uint8_t m

void ProtocolGame::sendPartyCreatureShowStatus(std::shared_ptr<Creature> target, bool showStatus) {
uint32_t cid = target->getID();
if (knownCreatureSet.find(cid) == knownCreatureSet.end()) {
if (!knownCreatureSet.contains(cid)) {
sendPartyCreatureUpdate(target);
}

Expand All @@ -5904,7 +5904,7 @@ void ProtocolGame::sendPartyCreatureShowStatus(std::shared_ptr<Creature> target,

void ProtocolGame::sendPartyPlayerVocation(std::shared_ptr<Player> target) {
uint32_t cid = target->getID();
if (knownCreatureSet.find(cid) == knownCreatureSet.end()) {
if (!knownCreatureSet.contains(cid)) {
sendPartyCreatureUpdate(target);
return;
}
Expand Down

0 comments on commit 737298d

Please sign in to comment.