Ver Fonte

Don't cast spells with below 0 score.

The AI will no longer cast spells if the best spell's value is still below 0.
Xilmi há 1 ano atrás
pai
commit
69dc32a128
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      AI/BattleAI/BattleEvaluator.cpp

+ 1 - 1
AI/BattleAI/BattleEvaluator.cpp

@@ -790,7 +790,7 @@ bool BattleEvaluator::attemptCastingSpell(const CStack * activeStack)
 	};
 	auto castToPerform = *vstd::maxElementByFun(possibleCasts, pscValue);
 
-	if(castToPerform.value > cachedScore)
+	if(castToPerform.value > cachedScore && castToPerform.value > 0)
 	{
 		LOGFL("Best spell is %s (value %d). Will cast.", castToPerform.spell->getNameTranslated() % castToPerform.value);
 		BattleAction spellcast;