Selaa lähdekoodia

UnitEffect: it should not always assume smart

It is normal than non-smart spell will be cast on our units.
Konstantin 2 vuotta sitten
vanhempi
sitoutus
705afbb898
1 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 4 4
      lib/spells/effects/UnitEffect.cpp

+ 4 - 4
lib/spells/effects/UnitEffect.cpp

@@ -40,7 +40,7 @@ bool UnitEffect::applicable(Problem & problem, const Mechanics * m) const
 {
 	//stack effect is applicable in general if there is at least one smart target
 
-	auto mainFilter = std::bind(&UnitEffect::getStackFilter, this, m, true, _1);
+	auto mainFilter = std::bind(&UnitEffect::getStackFilter, this, m, false, _1);
 	auto predicate = std::bind(&UnitEffect::eraseByImmunityFilter, this, m, _1);
 
 	auto targets = m->battle()->battleGetUnitsIf(mainFilter);
@@ -59,12 +59,12 @@ bool UnitEffect::applicable(Problem & problem, const Mechanics * m) const
 
 bool UnitEffect::applicable(Problem & problem, const Mechanics * m, const EffectTarget & target) const
 {
-	//stack effect is applicable if it affects at least one smart target
-	//assume target correctly transformed, just reapply smart filter
+	//stack effect is applicable if it affects at least one target (smartness should not be checked)
+	//assume target correctly transformed, just reapply filter
 
 	for(const auto & item : target)
 		if(item.unitValue)
-			if(getStackFilter(m, true, item.unitValue))
+			if(getStackFilter(m, false, item.unitValue))
 				return true;
 
 	return false;