Skip to content

Commit

Permalink
Merge pull request #4792 from Sleet01/fix_3870_no_aat_quirk_when_targ…
Browse files Browse the repository at this point in the history
…eting_aircraft

Fix #3870 
Fix #4524
  • Loading branch information
NickAragua authored Sep 21, 2023
2 parents 5fa96dd + 7b896e1 commit 027a6d3
Show file tree
Hide file tree
Showing 4 changed files with 255 additions and 210 deletions.
2 changes: 1 addition & 1 deletion megamek/src/megamek/client/ui/swing/QuirksPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void refreshQuirks() {
for (Enumeration<IOption> j = group.getSortedOptions(); j.hasMoreElements(); ) {
IOption option = j.nextElement();

if (!Quirks.isQuirkLegalFor(option, entity)) {
if (null == option || !Quirks.isQuirkLegalFor(option, entity)) {
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion megamek/src/megamek/client/ui/swing/tooltip/TipUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private static String optionListFull(Enumeration<IOptionGroup> advGroups,
List<String> origList = new ArrayList<>();
for (Enumeration<IOption> advs = advGroup.getOptions(); advs.hasMoreElements();) {
IOption adv = advs.nextElement();
if (adv.booleanValue()) {
if (adv != null && adv.booleanValue()) {
origList.add(adv.getDisplayableNameWithValue());
}
}
Expand Down
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/QuirksHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ public static void addCustomQuirk(Entity entity, boolean useModel) {
while (quirkOptions.hasMoreElements()) {
IOption option = quirkOptions.nextElement();
// Ignore illegal quirks, and ones that aren't set
if (!Quirks.isQuirkLegalFor(option, entity) || !option.booleanValue()) {
if (option == null || !(Quirks.isQuirkLegalFor(option, entity) && option.booleanValue())) {
continue;
}
// Add new QuirkEntry
Expand Down
Loading

0 comments on commit 027a6d3

Please sign in to comment.