Skip to content

Commit

Permalink
Merge pull request #4748 from kuronekochomusuke/bvMatchingAlphaStrike…
Browse files Browse the repository at this point in the history
…Filter

correct issue with bv matching alpha strike filter not applying
  • Loading branch information
SJuliez authored Sep 8, 2023
2 parents 14e1b38 + d93fb02 commit b3bf607
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions megamek/src/megamek/common/util/RandomArmyCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,18 @@ public static List<MechSummary> generateArmy(Parameters p, StringBuilder sbMech,
}

//ignoring infantry, BA and Proto for advancedSearch filter
if (((!m.getUnitType().equals(UnitType.getTypeName(UnitType.INFANTRY)))
&& (!m.getUnitType().equals(UnitType.getTypeName(UnitType.PROTOMEK)))
&& (!m.getUnitType().equals(UnitType.getTypeName(UnitType.BATTLE_ARMOR))))
&& (p.advancedSearchFilter != null && !MechSearchFilter.isMatch(m, p.advancedSearchFilter))
&& p.asPanel.matches(m))
{
if (!m.getUnitType().equals(UnitType.getTypeName(UnitType.INFANTRY))
&& !m.getUnitType().equals(UnitType.getTypeName(UnitType.PROTOMEK))
&& !m.getUnitType().equals(UnitType.getTypeName(UnitType.BATTLE_ARMOR))
&& (p.advancedSearchFilter != null && !MechSearchFilter.isMatch(m, p.advancedSearchFilter))) {
continue;
}

//ignoring infantry, BA and Proto for AS filter
if (!m.getUnitType().equals(UnitType.getTypeName(UnitType.INFANTRY))
&& !m.getUnitType().equals(UnitType.getTypeName(UnitType.PROTOMEK))
&& !m.getUnitType().equals(UnitType.getTypeName(UnitType.BATTLE_ARMOR))
&& !p.asPanel.matches(m)) {
continue;
}

Expand Down

0 comments on commit b3bf607

Please sign in to comment.