diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/casualty/CasualtySelector.java b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/casualty/CasualtySelector.java index 307686e509..ff699cfd75 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/casualty/CasualtySelector.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/delegate/battle/casualty/CasualtySelector.java @@ -263,10 +263,10 @@ private static Tuple> getDefaultCasualties( final List sorted = getCasualtyOrderOfLoss(targetsToPickFrom, player, combatValue, battlesite, costs, data); // Remove two hit bb's selecting them first for default casualties - int numSelectedCasualties = 0; if (allowMultipleHitsPerUnit) { for (final Unit unit : sorted) { // Stop if we have already selected as many hits as there are targets + final int numSelectedCasualties = defaultCasualtySelection.size(); if (numSelectedCasualties >= hits) { return Tuple.of(defaultCasualtySelection, sorted); } @@ -274,7 +274,6 @@ private static Tuple> getDefaultCasualties( final int extraHitPoints = Math.min((hits - numSelectedCasualties), (ua.getHitPoints() - (1 + unit.getHits()))); for (int i = 0; i < extraHitPoints; i++) { - numSelectedCasualties++; defaultCasualtySelection.addToDamaged(unit); } } @@ -282,11 +281,10 @@ private static Tuple> getDefaultCasualties( // Select units for (final Unit unit : sorted) { // Stop if we have already selected as many hits as there are targets - if (numSelectedCasualties >= hits) { + if (defaultCasualtySelection.size() >= hits) { return Tuple.of(defaultCasualtySelection, sorted); } defaultCasualtySelection.addToKilled(unit); - numSelectedCasualties++; } return Tuple.of(defaultCasualtySelection, sorted); }