Skip to content

Commit 7ecb140

Browse files
MostCromulentclaude
andcommitted
Route auto-apply pref read through YieldController overlay
The auto-apply read at orderSimultaneousSa was reading the host's local FPref, so remote clients silently inherited the host's reorder-mode setting — meaning Auto mode skipped the prompt for remote clients regardless of their own setting. Add UI_REORDER_SIMULTANEOUS_ABILITY_MODE to SYNCED_PREFS so the seed snapshot ships the client's value at match start, and read via getStringPref() (override wins, FModel fallback) instead of FModel directly. Local-host PCH continues to fall through to FModel since prefOverrides is only populated on remote-player proxies. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d9f6ec0 commit 7ecb140

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

forge-gui/src/main/java/forge/gamemodes/match/YieldController.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*/
4242
public class YieldController {
4343

44-
/** Yield FPrefs synced per-PCH; enumerated here so the client snapshot includes every value, not just touched overrides.
44+
/** Controller-scoped FPrefs synced per-PCH; enumerated here so the client snapshot includes every value, not just touched overrides.
4545
* Stored String-typed (see {@link forge.localinstance.properties.PreferencesStore}); consumers parse via {@link #getBoolPref}/{@link #getStringPref} according to the pref's expected type. */
4646
private static final EnumSet<FPref> SYNCED_PREFS = EnumSet.of(
4747
FPref.YIELD_INTERRUPT_ON_ATTACKERS,
@@ -58,7 +58,8 @@ public class YieldController {
5858
FPref.YIELD_SUPPRESS_AFTER_END,
5959
FPref.YIELD_AVAILABLE_ACTIONS_BUDGET_MS,
6060
FPref.YIELD_DECLINE_SCOPE_STACK_YIELD,
61-
FPref.YIELD_DECLINE_SCOPE_NO_ACTIONS);
61+
FPref.YIELD_DECLINE_SCOPE_NO_ACTIONS,
62+
FPref.UI_REORDER_SIMULTANEOUS_ABILITY_MODE);
6263

6364
private final PlayerControllerHuman owner;
6465

forge-gui/src/main/java/forge/player/PlayerControllerHuman.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@ public List<SpellAbility> orderSimultaneousSa(List<SpellAbility> activePlayerSAs
20242024
}
20252025
if (needPrompt) {
20262026
List<Integer> savedOrder = orderedSALookup.get(saLookupKey.toString());
2027-
String mode = FModel.getPreferences().getPref(FPref.UI_REORDER_SIMULTANEOUS_ABILITY_MODE);
2027+
String mode = yieldController.getStringPref(FPref.UI_REORDER_SIMULTANEOUS_ABILITY_MODE);
20282028

20292029
if (savedOrder != null && ForgeConstants.REORDER_SIMULTANEOUS_AUTO.equals(mode)) {
20302030
List<SpellAbility> orderedSAs = Lists.newArrayListWithCapacity(savedOrder.size());

0 commit comments

Comments
 (0)