From 4a77c3e85a784f6698338e4fc981a1593adec730 Mon Sep 17 00:00:00 2001 From: RickyRister Date: Fri, 27 Dec 2024 21:45:03 -0800 Subject: [PATCH] fix downloading single replays --- cockatrice/src/client/tabs/tab_replays.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/client/tabs/tab_replays.cpp b/cockatrice/src/client/tabs/tab_replays.cpp index 052c5aa31..5c728c304 100644 --- a/cockatrice/src/client/tabs/tab_replays.cpp +++ b/cockatrice/src/client/tabs/tab_replays.cpp @@ -335,7 +335,8 @@ void TabReplays::downloadNodeAtIndex(const QModelIndex &curLeft, const QModelInd } } else if (const auto replay = serverDirView->getReplay(curRight)) { // node at index is a replay - const QString filePath = localDirModel->filePath(curLeft) + QString("/replay_%1.cor").arg(replay->replay_id()); + const QString dirPath = curLeft.isValid() ? localDirModel->filePath(curLeft) : localDirModel->rootPath(); + const QString filePath = dirPath + QString("/replay_%1.cor").arg(replay->replay_id()); Command_ReplayDownload cmd; cmd.set_replay_id(replay->replay_id());