1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

codereview

This commit is contained in:
Laserlicht
2023-09-23 20:41:30 +02:00
committed by GitHub
parent ca96749c45
commit 6f8b62d77d
10 changed files with 50 additions and 58 deletions

View File

@@ -600,7 +600,7 @@ void CServerHandler::startGameplay(VCMI_LIB_WRAP_NAMESPACE(CGameState) * gameSta
CMM->disable();
client = new CClient();
calc = nullptr;
highScoreCalc = nullptr;
switch(si->mode)
{
@@ -678,14 +678,14 @@ void CServerHandler::startCampaignScenario(HighScoreParameter param, std::shared
if (!cs)
ourCampaign = si->campState;
if(calc == nullptr)
if(highScoreCalc == nullptr)
{
calc = std::make_shared<HighScoreCalculation>();
calc->isCampaign = true;
calc->parameters.clear();
highScoreCalc = std::make_shared<HighScoreCalculation>();
highScoreCalc->isCampaign = true;
highScoreCalc->parameters.clear();
}
param.campaign = cs->getName();
calc->parameters.push_back(param);
highScoreCalc->parameters.push_back(param);
GH.dispatchMainThread([ourCampaign, this]()
{
@@ -709,7 +709,7 @@ void CServerHandler::startCampaignScenario(HighScoreParameter param, std::shared
else
{
CMM->openCampaignScreen(ourCampaign->campaignSet);
GH.windows().createAndPushWindow<CHighScoreInputScreen>(true, *calc);
GH.windows().createAndPushWindow<CHighScoreInputScreen>(true, *highScoreCalc);
}
};
if(epilogue.hasPrologEpilog)