diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/ai/pro/util/ProSortMoveOptionsUtils.java b/game-app/game-core/src/main/java/games/strategy/triplea/ai/pro/util/ProSortMoveOptionsUtils.java index 63c4cb5b99..9b9dbf3570 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/ai/pro/util/ProSortMoveOptionsUtils.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/ai/pro/util/ProSortMoveOptionsUtils.java @@ -1,5 +1,6 @@ package games.strategy.triplea.ai.pro.util; +import com.google.common.base.Preconditions; import games.strategy.engine.data.GameData; import games.strategy.engine.data.GamePlayer; import games.strategy.engine.data.GameState; @@ -230,10 +231,12 @@ private static double calculateAttackEfficiency( minPower = powerDifference; } } - if (unit.getUnitAttachment().getIsAir()) { minPower *= 10; } - return (double) minPower / proData.getUnitValue(unit.getType()); + final double unitValue = proData.getUnitValue(unit.getType()); + final double result = unitValue == 0.0 ? 0.0 : (double) minPower / unitValue; + Preconditions.checkState(Double.isFinite(result)); + return result; } }