summaryrefslogtreecommitdiff
path: root/pkg/ui/views/game.go
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2025-04-24 18:19:39 +0200
committerSanto Cariotti <santo@dcariotti.me>2025-04-24 18:19:39 +0200
commitded19d8613f67a9a10834e2c4f6ed398d54c5638 (patch)
tree4902a9ce5937b7d144b996b9122d30df61b83168 /pkg/ui/views/game.go
parent162da285062bfdd47fa8254483a45a68f1cce421 (diff)
Fix winner text on co-op 2vs2
Diffstat (limited to 'pkg/ui/views/game.go')
-rw-r--r--pkg/ui/views/game.go8
1 files changed, 2 insertions, 6 deletions
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))
}
}
}