diff --git a/megamek/src/megamek/client/ui/swing/unitDisplay/WeaponPanel.java b/megamek/src/megamek/client/ui/swing/unitDisplay/WeaponPanel.java index aa3033e350f..7d6b5feb9a6 100644 --- a/megamek/src/megamek/client/ui/swing/unitDisplay/WeaponPanel.java +++ b/megamek/src/megamek/client/ui/swing/unitDisplay/WeaponPanel.java @@ -229,7 +229,7 @@ public String getElementAt(int index) { int totalShots = 0; EnumSet munition = ((AmmoType) mounted.getLinked().getType()).getMunitionType(); for (Mounted current = mounted.getLinked(); current != null; current = current.getLinked()) { - if (((AmmoType) current.getType()).getMunitionType() == munition) { + if (((AmmoType) current.getType()).getMunitionType().equals(munition)) { shotsLeft += current.getUsableShotsLeft(); totalShots += current.getOriginalShots(); } diff --git a/megamek/src/megamek/common/AmmoType.java b/megamek/src/megamek/common/AmmoType.java index f1a657e8d2f..02a9f72d3a3 100644 --- a/megamek/src/megamek/common/AmmoType.java +++ b/megamek/src/megamek/common/AmmoType.java @@ -407,7 +407,7 @@ public boolean isCompatibleWith(AmmoType other) { } // MML Launchers, ugh. - if ((is(T_MML) || other.is(T_MML)) && (getMunitionType() == other.getMunitionType())) { + if ((is(T_MML) || other.is(T_MML)) && (getMunitionType().equals(other.getMunitionType()))) { // LRMs... if (is(T_MML) && hasFlag(F_MML_LRM) && other.is(T_LRM)) { return true; @@ -424,7 +424,7 @@ public boolean isCompatibleWith(AmmoType other) { } // General Launchers - if (is(other.getAmmoType()) && (getMunitionType() == other.getMunitionType())) { + if (is(other.getAmmoType()) && (getMunitionType().equals(other.getMunitionType()))) { return true; }