1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Added constant for BATTLE_SHOOTING_RANGE_DISTANCE

This commit is contained in:
krs
2023-06-18 01:22:34 +03:00
parent e668ea3a03
commit 756dd398c2
3 changed files with 6 additions and 5 deletions

View File

@ -1456,7 +1456,7 @@ bool CBattleInfoCallback::battleHasDistancePenalty(const IBonusBearer * shooter,
if(const auto * target = battleGetUnitByPos(destHex, true))
{
//If any hex of target creature is within range, there is no penalty
int range = GameConstants::BATTLE_PENALTY_DISTANCE;
int range = GameConstants::BATTLE_SHOOTING_PENALTY_DISTANCE;
auto bonus = shooter->getBonus(Selector::type()(BonusType::LIMITED_SHOOTING_RANGE));
if(bonus != nullptr && bonus->additionalInfo != CAddInfo::NONE)
@ -1467,7 +1467,7 @@ bool CBattleInfoCallback::battleHasDistancePenalty(const IBonusBearer * shooter,
}
else
{
if(BattleHex::getDistance(shooterPosition, destHex) <= GameConstants::BATTLE_PENALTY_DISTANCE)
if(BattleHex::getDistance(shooterPosition, destHex) <= GameConstants::BATTLE_SHOOTING_PENALTY_DISTANCE)
return false;
}