Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 3870 and 4524: no quirks / SPAs applied to Artillery weapons #4792

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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