From 5cced646842b84d4b8aaacdce54462d788c422ca Mon Sep 17 00:00:00 2001 From: algebro Date: Wed, 7 Aug 2024 17:26:57 -0400 Subject: [PATCH] check highest thresh even if a normal thresh happened; fix bug in stream filter --- megamek/src/megamek/server/GameManager.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/megamek/src/megamek/server/GameManager.java b/megamek/src/megamek/server/GameManager.java index 07d0d3a1e9b..82b48b26502 100644 --- a/megamek/src/megamek/server/GameManager.java +++ b/megamek/src/megamek/server/GameManager.java @@ -19358,9 +19358,10 @@ void checkForPSRFromDamage() { damThresh.addModifier(-1, "easy to pilot"); } getGame().addControlRoll(damThresh); - } else if (getGame().getOptions().booleanOption(OptionsConstants.ADVAERORULES_ATMOSPHERIC_CONTROL) - && entity.damageThisRound > ((IAero) entity).getHighestThresh()) { - // did the damage exceed the unit's highest threshold? + } + if (getGame().getOptions().booleanOption(OptionsConstants.ADVAERORULES_ATMOSPHERIC_CONTROL) + && entity.damageThisPhase > ((IAero) entity).getHighestThresh()) { + // did the total damage this round exceed the unit's highest threshold? PilotingRollData damThresh = new PilotingRollData(entity.getId(), 0, "highest damage threshold exceeded"); if (entity.hasQuirk(OptionsConstants.QUIRK_POS_EASY_PILOT) @@ -20296,7 +20297,7 @@ void resolveControlWithAdvAtmospheric(Entity e, PilotingRollData target, Vector< if (modifier.getEntityId() != e.getId()) { continue; } - if (Stream.of("threshold exceeded", "avionics hit", "critical hit").anyMatch(s -> modifier.getDesc().contains(s))) { + if (Stream.of("threshold", "avionics hit", "critical hit").anyMatch(s -> modifier.getDesc().contains(s))) { if (atmosphericControlRoll == null) { atmosphericControlRoll = modifier; } else {