1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Use BattleHex as const ref wherever possible

Minor Fixes
Drop unused function from BattleHexArray
This commit is contained in:
MichalZr6
2025-01-13 14:12:00 +01:00
parent 8f63a82d60
commit ecdd394bb1
56 changed files with 335 additions and 355 deletions

View File

@@ -508,7 +508,7 @@ bool BattleSpellMechanics::counteringSelector(const Bonus * bonus) const
return false;
}
BattleHexArray BattleSpellMechanics::spellRangeInHexes(BattleHex centralHex) const
BattleHexArray BattleSpellMechanics::spellRangeInHexes(const BattleHex & centralHex) const
{
using namespace SRSLPraserHelpers;
@@ -612,7 +612,7 @@ std::vector<Destination> BattleSpellMechanics::getPossibleDestinations(size_t in
hexesToCheck.insert(stack->getPosition().getNeighbouringTiles());
}
for(auto hex : hexesToCheck)
for(const auto & hex : hexesToCheck)
{
if(hex.isAvailable())
{
@@ -659,7 +659,7 @@ bool BattleSpellMechanics::isReceptive(const battle::Unit * target) const
return targetCondition->isReceptive(this, target);
}
BattleHexArray BattleSpellMechanics::rangeInHexes(BattleHex centralHex) const
BattleHexArray BattleSpellMechanics::rangeInHexes(const BattleHex & centralHex) const
{
if(isMassive() || !centralHex.isValid())
return BattleHexArray();