Commit 7f15a52
Refresh local-player controller keys on match restart
Root-cause fix for docked zone tabs showing the previous game's cards after
"Start New Match".
getLocalPlayers() returns gameControllers.keySet(), keyed by PlayerView
(equality is by id). Desktop reuses the GUI across matches without clearing
the map, so when setOriginalGameController re-registers the new game's live
PlayerView, HashMap.put keeps the id-equal old key and only swaps the value --
keySet() then hands back the prior game's orphaned view, which never updates.
registerZoneDocs binds docked zones to that stale view.
Removing the id-equal entry before re-putting makes the live instance the key,
so getLocalPlayers() returns live views for every consumer. Only the key
changes; the value and all id-based lookups are untouched, so existing callers
behave identically. Reverts the desktop-scoped registerZoneDocs workaround.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 3fe6e02 commit 7f15a52
2 files changed
Lines changed: 5 additions & 8 deletions
File tree
- forge-gui-desktop/src/main/java/forge/screens/match
- forge-gui/src/main/java/forge/gamemodes/match
Lines changed: 1 addition & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
949 | | - | |
950 | | - | |
| 943 | + | |
951 | 944 | | |
952 | 945 | | |
953 | 946 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
193 | 195 | | |
| 196 | + | |
194 | 197 | | |
| 198 | + | |
195 | 199 | | |
196 | 200 | | |
197 | 201 | | |
| |||
0 commit comments