Skip to content

Commit

Permalink
Merge pull request #2544 from ssoloff/issue-2529-revert-2080
Browse files Browse the repository at this point in the history
Revert #2080
  • Loading branch information
ron-murhammer committed Oct 26, 2017
2 parents 61219cc + 65adaaf commit 714c72f
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/main/java/games/strategy/triplea/delegate/MustFightBattle.java
Original file line number Diff line number Diff line change
Expand Up @@ -773,13 +773,6 @@ List<IExecutable> getBattleExecutables(final boolean firstRun) {

@Override
public void execute(final ExecutionStack stack, final IDelegateBridge bridge) {
if (getBattlePower(true, m_attackingUnits, bridge, new ArrayList<>()) > 0) {
final List<Unit> unitsToRemove = new ArrayList<>();
if (getBattlePower(false, m_defendingUnits, bridge, unitsToRemove) == 0) {
remove(new ArrayList<>(Matches.getMatches(unitsToRemove, Matches.unitIsInfrastructure().invert())),
bridge, m_battleSite, true);
}
}
clearWaitingToDie(bridge);
}
});
Expand Down Expand Up @@ -2671,19 +2664,6 @@ public void unitsLostInPrecedingBattle(final IBattle battle, final Collection<Un
}
}

private int getBattlePower(final boolean attack, final List<Unit> units, final IDelegateBridge bridge,
final List<Unit> unitsToRemove) {
final Match<Unit> unitTypes = Matches.unitCanBeInBattle(attack, !m_battleSite.isWater(), 1, false, !attack, true);
final List<Unit> sortedUnits = new ArrayList<>(Matches.getMatches(units, unitTypes));
Collections.sort(sortedUnits, new UnitBattleComparator(!attack,
TuvUtils.getCostsForTuv(bridge.getPlayerId(), m_data),
TerritoryEffectHelper.getEffects(m_battleSite), m_data, false, false));
Collections.reverse(sortedUnits);
unitsToRemove.addAll(sortedUnits);
return DiceRoll.getTotalPower(DiceRoll.getUnitPowerAndRollsForNormalBattles(sortedUnits, units, !attack,
false, m_data, m_battleSite, TerritoryEffectHelper.getEffects(m_battleSite), false, null), m_data);
}

/**
* Returns a map of transport -> collection of transported units.
*/
Expand Down

0 comments on commit 714c72f

Please sign in to comment.