1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

calc preperation

This commit is contained in:
Laserlicht
2023-09-23 00:21:36 +02:00
committed by GitHub
parent b0e5a11e62
commit 1a0f5cf159
6 changed files with 62 additions and 10 deletions

View File

@@ -669,14 +669,18 @@ void CServerHandler::endGameplay(bool closeConnection, bool restart)
saveSession->Bool() = false;
}
void CServerHandler::startCampaignScenario(std::shared_ptr<CampaignState> cs)
void CServerHandler::startCampaignScenario(HighScoreParameter param, std::shared_ptr<CampaignState> cs)
{
std::shared_ptr<CampaignState> ourCampaign = cs;
if (!cs)
{
ourCampaign = si->campState;
calc.parameters.clear();
}
calc.parameters.push_back(param);
GH.dispatchMainThread([ourCampaign]()
GH.dispatchMainThread([ourCampaign, this]()
{
CSH->campaignServerRestartLock.set(true);
CSH->endGameplay();
@@ -698,7 +702,7 @@ void CServerHandler::startCampaignScenario(std::shared_ptr<CampaignState> cs)
else
{
CMM->openCampaignScreen(ourCampaign->campaignSet);
GH.windows().createAndPushWindow<CHighScoreInputScreen>(true);
GH.windows().createAndPushWindow<CHighScoreInputScreen>(true, calc);
}
};
if(epilogue.hasPrologEpilog)