Skip to content

Commit 9f6bd6e

Browse files
committed
refactor: Avoid unnecessary iteration when checking linked components of
bay weapons This leaves a lot of copy-pasted code in place, but untangling that is proving to be a bit of a headache, so this will suffice for the moment.
1 parent 175a3f1 commit 9f6bd6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

megamek/src/megamek/common/actions/WeaponAttackAction.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ private static ToHitData toHitCalc(Game game, int attackerId, Targetable target,
468468
&& (munition.contains(AmmoType.Munitions.M_ARTEMIS_V_CAPABLE)));
469469

470470
if (ae.usesWeaponBays()) {
471-
for (WeaponMounted bayW : weapon.getBayWeapons()) {
471+
for (WeaponMounted bayW : weapon.streamBayWeapons()) {
472472
Mounted<?> bayWAmmo = bayW.getLinked();
473473

474474
if (bayWAmmo == null) {

0 commit comments

Comments
 (0)