소스 검색

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