diff options
author | Santo Cariotti <santo@dcariotti.me> | 2025-04-18 13:17:19 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2025-04-18 13:17:19 +0200 |
commit | 040b6e169dbd78b0f79921e4590e49b8970f685f (patch) | |
tree | 9f051bc0e4b8d581d514a4b29f5061bbd0fe1534 /pkg/ui/views/game.go | |
parent | fafd0111465ded6bfec5c0d91d7dd9c19ddac50b (diff) |
Use playname-n for peers instead of peer-1 and peer-2
Diffstat (limited to 'pkg/ui/views/game.go')
-rw-r--r-- | pkg/ui/views/game.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/ui/views/game.go b/pkg/ui/views/game.go index 8750789..4e8cc87 100644 --- a/pkg/ui/views/game.go +++ b/pkg/ui/views/game.go @@ -94,7 +94,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() == "peer-1" { + if m.network.Me() == m.playerPeer(1) { m.game.Outcome = string(chess.WhiteWon) } else { m.game.Outcome = string(chess.BlackWon) @@ -173,12 +173,12 @@ func (m GameModel) View() string { switch m.game.Outcome { case string(chess.WhiteWon): outcome = "White won" - if m.network.Me() == "peer-1" { + if m.network.Me() == m.playerPeer(1) { outcome += " (YOU)" } case string(chess.BlackWon): outcome = "Black won" - if m.network.Me() == "peer-2" { + if m.network.Me() == m.playerPeer(2) { outcome += " (YOU)" } case string(chess.Draw): |