-
Notifications
You must be signed in to change notification settings - Fork 81
PDS warning before continuing with combat/landing #4579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5967,6 +5967,13 @@ private static void resolveCombatRoll( | |||||
| case "spacecannondefence" -> rollType = CombatRollType.SpaceCannonDefence; | ||||||
| default -> {} | ||||||
| } | ||||||
| if ((rollType == CombatRollType.combatround || rollType == CombatRollType.AFB) | ||||||
| && warnIfPendingPdsDecisions(player, game, event)) { | ||||||
| return; | ||||||
| } | ||||||
| if (rollType == CombatRollType.SpaceCannonOffence) { | ||||||
|
||||||
| if (rollType == CombatRollType.SpaceCannonOffence) { | |
| if (first && rollType == CombatRollType.SpaceCannonOffence) { |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -173,6 +173,7 @@ public void finishMovement(ButtonInteractionEvent event, Game game, Player playe | |||||||||||||||||||||||
| CommanderUnlockCheckService.checkPlayer(player, "obsidian"); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| if (!game.isL1Hero() && !ctx.playersWithPds2.isEmpty()) { | ||||||||||||||||||||||||
| ButtonHelper.setPendingPdsDecisions(game, ctx.playersWithPds2.size()); | ||||||||||||||||||||||||
| ButtonHelperTacticalAction.tacticalActionSpaceCannonOffenceStep( | ||||||||||||||||||||||||
| game, player, ctx.playersWithPds2, ctx.tile); | ||||||||||||||||||||||||
|
Comment on lines
175
to
178
|
||||||||||||||||||||||||
| if (!game.isL1Hero() && !ctx.playersWithPds2.isEmpty()) { | |
| ButtonHelper.setPendingPdsDecisions(game, ctx.playersWithPds2.size()); | |
| ButtonHelperTacticalAction.tacticalActionSpaceCannonOffenceStep( | |
| game, player, ctx.playersWithPds2, ctx.tile); | |
| if (!game.isL1Hero()) { | |
| int pendingPdsCount = ctx.playersWithPds2.size(); | |
| ButtonHelper.setPendingPdsDecisions(game, pendingPdsCount); | |
| if (pendingPdsCount > 0) { | |
| ButtonHelperTacticalAction.tacticalActionSpaceCannonOffenceStep( | |
| game, player, ctx.playersWithPds2, ctx.tile); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
declinePDSnow decrements the global pending-PDS counter, but this handler doesn’t prevent (a) non-eligible players from clicking Decline in the shared combat thread, or (b) the same player clicking Decline multiple times. Either case can incorrectly reduce the counter to 0 and remove the warning while other PDS-capable players still haven’t responded. Consider validating the clicker is in the eligible PDS-cover list for the relevant system and recording per-faction “responded” state so the decrement is only applied once per eligible player.