DjWarmonger 9 лет назад
Родитель
Сommit
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
 
 }