diff options
author | Santo Cariotti <santo@dcariotti.me> | 2025-04-22 19:48:19 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2025-04-22 19:48:19 +0200 |
commit | 582c7e029da991f5bf974f60985db27634059af5 (patch) | |
tree | 350844df3e70bf21c5a546b7144ea0f07f230d9b | |
parent | 3ccdd3a3909bd7390be4a9910a83383a0bd9d602 (diff) |
FIx duplicated code
-rw-r--r-- | pkg/ui/views/game_restore.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/ui/views/game_restore.go b/pkg/ui/views/game_restore.go index b2e647c..4ce8184 100644 --- a/pkg/ui/views/game_restore.go +++ b/pkg/ui/views/game_restore.go @@ -17,12 +17,11 @@ type RestoreMoves string // For `RestoreGameMessage` from multiplayer it fixes the peer with the new // address and sends back an ACK to the peer' sender func (m GameModel) handleSendRestoreMsg() tea.Cmd { + _ = m.getGame()() if m.network.Me() == m.playerPeer(1) { - _ = m.getGame()() remote := m.game.IP2 m.network.AddPeer(m.playerPeer(2), remote) } else { - _ = m.getGame()() remote := m.game.IP1 m.network.AddPeer(m.playerPeer(1), remote) } |