diff --git a/megamek/src/megamek/common/actions/WeaponAttackAction.java b/megamek/src/megamek/common/actions/WeaponAttackAction.java index a6679d8c8fd..f9ad241355c 100644 --- a/megamek/src/megamek/common/actions/WeaponAttackAction.java +++ b/megamek/src/megamek/common/actions/WeaponAttackAction.java @@ -1276,7 +1276,7 @@ private static String toHitIsImpossible(Game game, Entity ae, int attackerId, Ta boolean networkFiringSolution = false; //Check to see if the attacker has a firing solution. Naval C3 networks share targeting data if (ae.hasNavalC3() && te != null - && game.getC3NetworkMembers(ae).stream().anyMatch(en -> en.hasFiringSolutionFor(te.getId())) { + && game.getC3NetworkMembers(ae).stream().anyMatch(en -> en.hasFiringSolutionFor(te.getId()))) { networkFiringSolution = true; } if (!networkFiringSolution) { @@ -1299,15 +1299,14 @@ private static String toHitIsImpossible(Game game, Entity ae, int attackerId, Ta && (te != null) && te.hasSeenEntity(ae.getOwner())) && !isArtilleryIndirect && !isIndirect && !isBearingsOnlyMissile) { boolean networkSee = false; - if (ae.hasC3() || ae.hasC3i() || ae.hasActiveNovaCEWS()) { + if (ae.hasC3() || ae.hasC3i() || ae.hasActiveNovaCEWS() + && game.getEntitiesVector().stream().anyMatch(en -> + !en.isEnemyOf(ae) + && en.onSameC3NetworkAs(ae) + && Compute.canSee(game, en, target))) { // c3 units can fire if any other unit in their network is in // visual or sensor range - for (Entity en : game.getEntitiesVector()) { - if (!en.isEnemyOf(ae) && en.onSameC3NetworkAs(ae) && Compute.canSee(game, en, target)) { - networkSee = true; - break; - } - } + networkSee = true; } if (!networkSee) { if (!Compute.inSensorRange(game, ae, target, null)) {