Browse Source

Update PriorityEvaluator.cpp

Workaround for weird -nan(ind) closestWayRatios.
Xilmi 1 năm trước cách đây
mục cha
commit
1176628a88
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      AI/Nullkiller/Engine/PriorityEvaluator.cpp

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

@@ -1547,6 +1547,9 @@ float PriorityEvaluator::evaluate(Goals::TSubgoal task, int priorityTier)
 			}
 		}
 		result = score;
+		//TODO: Figure out the root cause for why evaluationContext.closestWayRatio has become -nan(ind).
+		if (std::isnan(result))
+			return 0;
 	}
 
 #if NKAI_TRACE_LEVEL >= 2