Skip to content

Commit

Permalink
Merge pull request #4805 from MegaMek/called_shots_partial_cover
Browse files Browse the repository at this point in the history
Fix #4738  Don't override called shots (high) for units with partial cover.
  • Loading branch information
NickAragua authored Sep 27, 2023
2 parents b4030d0 + 57ef600 commit 673eab1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions megamek/src/megamek/common/actions/WeaponAttackAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -4399,12 +4399,14 @@ private static ToHitData compileTerrainAndLosToHitMods(Game game, Entity ae, Tar
toHit.setCover(LosEffects.COVER_UPPER);
} else {
if (game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_TACOPS_PARTIAL_COVER)) {
toHit.setHitTable(ToHitData.HIT_PARTIAL_COVER);
toHit.setCover(los.getTargetCover());
} else {
toHit.setHitTable(ToHitData.HIT_PARTIAL_COVER);
toHit.setCover(LosEffects.COVER_HORIZONTAL);
}
// If this is a called shot (high) the table has already been set and should be used instead of partial cover.
if (toHit.getHitTable() != ToHitData.HIT_ABOVE) {
toHit.setHitTable(ToHitData.HIT_PARTIAL_COVER);
}
// Set damageable cover state information
toHit.setDamagableCoverTypePrimary(los.getDamagableCoverTypePrimary());
toHit.setCoverLocPrimary(los.getCoverLocPrimary());
Expand Down

0 comments on commit 673eab1

Please sign in to comment.