From e18a4a09a986ba97e3148dddfdd9b2f8acfe7782 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Sat, 23 Sep 2023 02:14:45 +0200 Subject: [PATCH] forward declaration --- client/CServerHandler.cpp | 8 ++++---- client/CServerHandler.h | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/client/CServerHandler.cpp b/client/CServerHandler.cpp index 9c105a9ed..6e18ebcb6 100644 --- a/client/CServerHandler.cpp +++ b/client/CServerHandler.cpp @@ -676,10 +676,10 @@ void CServerHandler::startCampaignScenario(HighScoreParameter param, std::shared if (!cs) { ourCampaign = si->campState; - calc.isCampaign = true; - calc.parameters.clear(); + calc->isCampaign = true; + calc->parameters.clear(); } - calc.parameters.push_back(param); + calc->parameters.push_back(param); GH.dispatchMainThread([ourCampaign, this]() { @@ -703,7 +703,7 @@ void CServerHandler::startCampaignScenario(HighScoreParameter param, std::shared else { CMM->openCampaignScreen(ourCampaign->campaignSet); - GH.windows().createAndPushWindow(true, calc); + GH.windows().createAndPushWindow(true, *calc); } }; if(epilogue.hasPrologEpilog) diff --git a/client/CServerHandler.h b/client/CServerHandler.h index 467092e9f..0b8b3f146 100644 --- a/client/CServerHandler.h +++ b/client/CServerHandler.h @@ -14,8 +14,6 @@ #include "../lib/StartInfo.h" #include "../lib/CondSh.h" -#include "mainmenu/CHighScoreScreen.h" - VCMI_LIB_NAMESPACE_BEGIN class CConnection; @@ -37,6 +35,9 @@ VCMI_LIB_NAMESPACE_END class CClient; class CBaseForLobbyApply; +class HighScoreCalculation; +class HighScoreParameter; + // TODO: Add mutex so we can't set CONNECTION_CANCELLED if client already connected, but thread not setup yet enum class EClientState : ui8 { @@ -88,7 +89,7 @@ class CServerHandler : public IServerAPI, public LobbyInfo std::vector myNames; - HighScoreCalculation calc; + std::shared_ptr calc; void threadHandleConnection(); void threadRunServer();