浏览代码

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
 
 }