Skip to content

Commit

Permalink
fix const auto &
Browse files Browse the repository at this point in the history
  • Loading branch information
kaleohanopahala authored Feb 11, 2025
1 parent bd4de41 commit 80dc306
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/creatures/combat/combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,11 @@ ReturnValue Combat::canDoCombat(const std::shared_ptr<Creature> &attacker, const
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER;
}

const auto targetMonster = target->getMonster();
const auto &targetMonster = target->getMonster();
if (target->getNpc()) {
return RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE;
} else if (targetMonster) {
const auto attackerMonster = attacker->getMonster();
const auto &attackerMonster = attacker->getMonster();
if (attacker->getFaction() != FACTION_DEFAULT && attacker->getFaction() != FACTION_PLAYER && attackerMonster && !attackerMonster->isEnemyFaction(target->getFaction())) {
return RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE;
}
Expand Down

0 comments on commit 80dc306

Please sign in to comment.