1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fix assert and condition for counting spell hexes

This commit is contained in:
Dydzio
2024-09-22 18:25:18 +02:00
parent bf9a9283a4
commit bb69ab1a1a
4 changed files with 5 additions and 4 deletions

View File

@@ -740,8 +740,8 @@ bool CBattleInfoCallback::battleCanTargetEmptyHex(const battle::Unit * attacker)
if(spell->isDamage())
{
spells::BattleCast cast(this, attacker, spells::Mode::SPELL_LIKE_ATTACK, spell);
if(vstd::find(spell->battleMechanics(&cast)->getTargetTypes(), spells::AimType::LOCATION) != spell->battleMechanics(&cast)->getTargetTypes().end())
BattleHex dummySpellTarget = BattleHex(50); //check arbitrary hex for general spell range since currently there is no general way to access amount of hexes
if(spell->battleMechanics(&cast)->rangeInHexes(dummySpellTarget).size() > 1)
{
return true;
}