1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-10-08 23:22:25 +02:00

Make any hex shooting possibility configurable

This commit is contained in:
Dydzio
2024-09-22 16:58:15 +02:00
parent 1a2d349267
commit bf9a9283a4
4 changed files with 8 additions and 0 deletions

View File

@@ -17,6 +17,7 @@
#include "BattleInfo.h"
#include "CObstacleInstance.h"
#include "DamageCalculator.h"
#include "IGameSettings.h"
#include "PossiblePlayerBattleAction.h"
#include "../entities/building/TownFortifications.h"
#include "../spells/ObstacleCasterProxy.h"
@@ -729,6 +730,9 @@ bool CBattleInfoCallback::battleCanTargetEmptyHex(const battle::Unit * attacker)
{
RETURN_IF_NOT_BATTLE(false);
if(!VLC->engineSettings()->getBoolean(EGameSettings::COMBAT_AREA_SHOT_CAN_TARGET_EMPTY_HEX))
return false;
if(attacker->hasBonusOfType(BonusType::SPELL_LIKE_ATTACK))
{
auto bonus = attacker->getBonus(Selector::type()(BonusType::SPELL_LIKE_ATTACK));