AlexVinS 10 anni fa
parent
commit
395070b584
1 ha cambiato i file con 7 aggiunte e 2 eliminazioni
  1. 7 2
      lib/HeroBonus.cpp

+ 7 - 2
lib/HeroBonus.cpp

@@ -500,8 +500,13 @@ bool IBonusBearer::isLiving() const //TODO: theoreticaly there exists "LIVING" b
 const TBonusListPtr IBonusBearer::getSpellBonuses() const
 {
 	std::stringstream cachingStr;
-	cachingStr << "source_" << Bonus::SPELL_EFFECT;
-	return getBonuses(Selector::sourceType(Bonus::SPELL_EFFECT), Selector::anyRange(), cachingStr.str());
+	cachingStr << "!type_" << Bonus::NONE << "source_" << Bonus::SPELL_EFFECT;
+	CSelector selector = Selector::sourceType(Bonus::SPELL_EFFECT)
+		.And(CSelector([](const Bonus * b)->bool
+		{
+			return !b->type == Bonus::NONE;
+		})); 
+	return getBonuses(selector, Selector::anyRange(), cachingStr.str());
 }
 
 const Bonus * IBonusBearer::getEffect(ui16 id, int turn /*= 0*/) const