소스 검색

Fixed CID 1288882

DjWarmonger 9 년 전
부모
커밋
a86edca7d8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      AI/VCAI/Fuzzy.cpp

+ 1 - 1
AI/VCAI/Fuzzy.cpp

@@ -219,7 +219,7 @@ ui64 FuzzyHelper::estimateBankDanger (const CBank * bank)
 		totalStrength += config.second.totalStrength * config.first;
 		totalChance += config.first;
 	}
-	return totalStrength / totalChance;
+	return totalStrength / std::max<ui8>(totalChance, 1); //avoid division by zero
 
 }