adminandClaude Opus 4.6 d4fbcb1987 Swap models when available provinces change, even mid-selection
Two related bugs in EagleGameController could leave the UI pointing
at provinces that the model no longer considers actionable:

1. SwapModel's early return at the "still have commands" check skipped
   the swap unconditionally whenever both the old and new model had
   any commands. When a refresh arrived after a phase advance, the
   controllers (mapController.SelectedProvinceId, _commandPanelController,
   mapController.ProvincesWithCommands, etc.) kept pointing at the old
   provinces, but _currentModel.CommandToken in the model layer had
   already advanced. A subsequent commit then posted a stale province
   with the freshly-advanced token, producing
   "Attempted to select province N out of TreeSet(...)" on the server.

   Tighten the early return to only skip when the available province
   set is identical between the two models. If the set has changed,
   we must swap so stale UI references get cleared.

2. NextActiveProvinceKeyPair used .First(predicate) to look up the
   suggested province, which throws InvalidOperationException when
   no element matches. This can happen when SuggestedProvinceId lags
   AvailableCommandsByProvince by a refresh, and the throw aborts
   SwapModel partway through — leaving a half-updated UI behind.
   Switch to TryGetValue with a fallback to the first available
   province.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 21:35:08 -07:00
2025-03-30 11:19:46 -07:00
2025-09-24 08:13:22 -07:00
2014-11-16 21:03:14 -08:00
S
Description
No description provided
Readme
9.4 GiB
Languages
Scala 44.5%
C++ 19.9%
C# 16.6%
Starlark 10.1%
Go 3.5%
Other 5.3%