浏览代码

Update lib/spells/BattleSpellMechanics.cpp

Fixes a lambda's captured values in BattleSpellMechanics.

Co-authored-by: Ivan Savenko <[email protected]>

Opuszek 3 月之前
父节点
当前提交
94ad9d536b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/spells/BattleSpellMechanics.cpp

+ 1 - 1
lib/spells/BattleSpellMechanics.cpp

@@ -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);