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

Update lib/spells/BattleSpellMechanics.cpp

Fixes a lambda's captured values in BattleSpellMechanics.

Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
This commit is contained in:
Opuszek
2025-07-07 21:11:57 +02:00
committed by GitHub
parent f7bd9de59f
commit 94ad9d536b

View File

@@ -466,7 +466,7 @@ void BattleSpellMechanics::reflect(BattleSpellCast & sc, vstd::RNG & rng, const
const battle::Unit * BattleSpellMechanics::getRandomUnit(vstd::RNG & rng, BattleSide & side)
{
auto targets = battle()->getBattle()->getUnitsIf([this, & side](const battle::Unit * unit)
auto targets = battle()->getBattle()->getUnitsIf([&side](const battle::Unit * unit)
{
return unit->unitSide() == side && unit->isValidTarget(false) &&
!unit->hasBonusOfType(BonusType::SIEGE_WEAPON);