mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Merge pull request #2559 from IvanSavenko/campaign_bonus_fix
Preserve chosen campaign bonus on scenario restart request
This commit is contained in:
commit
aef8ef1d55
@ -277,6 +277,12 @@ void CVCMIServer::prepareToRestart()
|
||||
* si = * gh->gs->initialOpts;
|
||||
si->seedToBeUsed = si->seedPostInit = 0;
|
||||
state = EServerState::LOBBY;
|
||||
if (si->campState)
|
||||
{
|
||||
assert(si->campState->currentScenario().has_value());
|
||||
campaignMap = si->campState->currentScenario().value_or(CampaignScenarioID(0));
|
||||
campaignBonus = si->campState->getBonusID(campaignMap).value_or(-1);
|
||||
}
|
||||
// FIXME: dirry hack to make sure old CGameHandler::run is finished
|
||||
boost::this_thread::sleep(boost::posix_time::milliseconds(1000));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user