ソースを参照

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 1 年間 前
コミット
69dc32a128
1 ファイル変更1 行追加1 行削除
  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);
 	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);
 		LOGFL("Best spell is %s (value %d). Will cast.", castToPerform.spell->getNameTranslated() % castToPerform.value);
 		BattleAction spellcast;
 		BattleAction spellcast;