From 0436bc413371ff839fd6d1da3835f999751bef5f Mon Sep 17 00:00:00 2001 From: ZeldaZach Date: Fri, 17 Jan 2025 02:41:45 -0500 Subject: [PATCH] Fix opening replays --- cockatrice/src/client/tabs/tab_game.cpp | 4 ++-- cockatrice/src/client/tabs/tab_game.h | 2 +- cockatrice/src/client/tabs/tab_supervisor.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cockatrice/src/client/tabs/tab_game.cpp b/cockatrice/src/client/tabs/tab_game.cpp index 9dd92c4c6..0d2329f49 100644 --- a/cockatrice/src/client/tabs/tab_game.cpp +++ b/cockatrice/src/client/tabs/tab_game.cpp @@ -65,8 +65,8 @@ #include #include -TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay) - : Tab(_tabSupervisor), secondsElapsed(0), hostId(-1), localPlayerId(-1), +TabGame::TabGame(TabSupervisor *_tabSupervisor, UserListProxy *_userListProxy, GameReplay *_replay) + : Tab(_tabSupervisor), userListProxy(_userListProxy), secondsElapsed(0), hostId(-1), localPlayerId(-1), isLocalGame(_tabSupervisor->getIsLocalGame()), spectator(true), judge(false), gameStateKnown(false), resuming(false), currentPhase(-1), activeCard(nullptr), gameClosed(false), replay(_replay), currentReplayStep(0), sayLabel(nullptr), sayEdit(nullptr) diff --git a/cockatrice/src/client/tabs/tab_game.h b/cockatrice/src/client/tabs/tab_game.h index 76ec5f97e..5ea01c21b 100644 --- a/cockatrice/src/client/tabs/tab_game.h +++ b/cockatrice/src/client/tabs/tab_game.h @@ -216,7 +216,7 @@ public: QList &_clients, const Event_GameJoined &event, const QMap &_roomGameTypes); - TabGame(TabSupervisor *_tabSupervisor, GameReplay *replay); + TabGame(TabSupervisor *_tabSupervisor, UserListProxy *_userListProxy, GameReplay *replay); ~TabGame() override; void retranslateUi() override; void updatePlayerListDockTitle(); diff --git a/cockatrice/src/client/tabs/tab_supervisor.cpp b/cockatrice/src/client/tabs/tab_supervisor.cpp index afad71b61..98af7fdf3 100644 --- a/cockatrice/src/client/tabs/tab_supervisor.cpp +++ b/cockatrice/src/client/tabs/tab_supervisor.cpp @@ -648,7 +648,7 @@ void TabSupervisor::roomLeft(TabRoom *tab) void TabSupervisor::openReplay(GameReplay *replay) { - auto *replayTab = new TabGame(this, replay); + auto *replayTab = new TabGame(this, userListManager, replay); connect(replayTab, &TabGame::gameClosing, this, &TabSupervisor::replayLeft); myAddTab(replayTab); replayTabs.append(replayTab);