From ded19d8613f67a9a10834e2c4f6ed398d54c5638 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 24 Apr 2025 18:19:39 +0200 Subject: Fix winner text on co-op 2vs2 --- pkg/ui/views/game.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'pkg/ui/views/game.go') diff --git a/pkg/ui/views/game.go b/pkg/ui/views/game.go index 8f63419..64e463b 100644 --- a/pkg/ui/views/game.go +++ b/pkg/ui/views/game.go @@ -106,11 +106,7 @@ func (m GameModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { cmds = append(cmds, cmd, m.updateMovesListCmd()) case EndGameMsg: if msg.abandoned { - if m.network.Me() == m.playerPeer(1) || m.network.Me() == m.playerPeer(3) { - m.game.Outcome = string(chess.WhiteWon) - } else { - m.game.Outcome = string(chess.BlackWon) - } + _ = m.getGame()() m, cmd = m.handleDatabaseGameMsg(*m.game) cmds = append(cmds, cmd) } @@ -143,7 +139,7 @@ func (m GameModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { cmds = append(cmds, m.getMoves(), m.updateMovesListCmd()) if m.chessGame.Outcome() != chess.NoOutcome { - cmds = append(cmds, m.endGame(m.chessGame.Outcome().String())) + cmds = append(cmds, m.endGame(m.chessGame.Outcome().String(), false)) } } } -- cgit v1.2.3-18-g5258