Commit d01e9c3f authored by Nico Kruber's avatar Nico Kruber
Browse files

fix becai minimumBaseDefenceFleetSize calculation

there were only integer divisions which is probably not what was intended here (the casts to double were missing)
found by msvc complaining about the unknown std::ceil(int) overload
parent b28ea001
......@@ -205,7 +205,7 @@ AiBecai::play()
// including us). Actually it is the production that counts and not the
// planets, but planets are good enough for us here for the moment.
int minimumBaseDefenceFleetSize = (int) std::ceil(((totalOwnFleet / 2) / totalOwnPlanets) * (1 - (totalOwnPlanets / (totalOwnPlanets + totalEnemyPlanets))));
int minimumBaseDefenceFleetSize = (int) std::ceil(((totalOwnFleet / 2.0) / totalOwnPlanets) * (1 - ((double) totalOwnPlanets / (totalOwnPlanets + totalEnemyPlanets))));
int originalMinimumBaseDefenceFleetSize = minimumBaseDefenceFleetSize;
// Try to keep the defence above the universe average so that our planets
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment