Browse Source

Update PriorityEvaluator.cpp

Further working towards heroes avoiding danger.
Xilmi 1 year ago
parent
commit
ec5da0e6b3
1 changed files with 5 additions and 0 deletions
  1. 5 0
      AI/Nullkiller/Engine/PriorityEvaluator.cpp

+ 5 - 0
AI/Nullkiller/Engine/PriorityEvaluator.cpp

@@ -1466,6 +1466,11 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
 							score /= turnsTo;
 					}
 				}
+				else
+				{
+					if (evaluationContext.enemyHeroDangerRatio > 0.5 && !evaluationContext.isDefend)
+						return 0;
+				}
 				break;
 			}
 		}