Skip to content

Fix crash on game end from unfillable layout gap#10897

Open
MostCromulent wants to merge 1 commit into
Card-Forge:masterfrom
MostCromulent:fix-fillgap-game-end-crash
Open

Fix crash on game end from unfillable layout gap#10897
MostCromulent wants to merge 1 commit into
Card-Forge:masterfrom
MostCromulent:fix-fillgap-game-end-crash

Conversation

@MostCromulent

@MostCromulent MostCromulent commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Discord user reported UnsupportedOperationException: Gap was not filled. thrown from SRearrangingUtil.fillGap() via FloatingZone.closeAll() -> CMatchUI.finishGame() at the end of a game (triggered by docking AI commanders'' command zones). Because closeAll() is the first thing finishGame() does, the throw aborted it before the win/lose screen was shown, leaving the match UI stuck.

fillGap() tears down docked zone cells one at a time, and the intermediate layout can leave a gap the grow-a-neighbor algorithm can''t cover. Gap-filling is purely cosmetic and the caller removes the cell regardless, so this drops the fatal throw and lets fillGap() fall through instead.


🤖 Generated with Claude Code

SRearrangingUtil.fillGap() threw UnsupportedOperationException when a removed cell's
gap could not be filled by a neighboring cell. At game end, FloatingZone.closeAll()
tears down docked zone cells one at a time (e.g. several command-zone cells when AI
commanders' zones are docked), and the intermediate layout can leave a gap the
grow-a-neighbor algorithm can't cover. The throw propagated out of
CMatchUI.finishGame() before the win/lose screen was shown, leaving the match UI
stuck.

Gap-filling is cosmetic and the caller removes the cell regardless, so fall through
rather than throw.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant