mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
possibility to restart
This commit is contained in:
parent
4784ae94b5
commit
1586b9fbd1
@ -180,7 +180,7 @@ void CPlayerInterface::playerStartsTurn(PlayerColor player)
|
||||
GH.windows().pushWindow(adventureInt);
|
||||
}
|
||||
|
||||
//close window from another player
|
||||
// close window from another player
|
||||
if(auto w = GH.windows().topWindow<CInfoWindow>())
|
||||
if(w->ID == -1 && player != playerID)
|
||||
w->close();
|
||||
@ -201,8 +201,6 @@ void CPlayerInterface::playerStartsTurn(PlayerColor player)
|
||||
|
||||
void CPlayerInterface::performAutosave()
|
||||
{
|
||||
std::string id = cb->getStartInfo()->gameUuid.substr(0, 4);
|
||||
|
||||
int frequency = static_cast<int>(settings["general"]["saveFrequency"].Integer());
|
||||
if(frequency > 0 && cb->getDate() % frequency == 0)
|
||||
{
|
||||
@ -232,7 +230,7 @@ void CPlayerInterface::performAutosave()
|
||||
+ std::to_string(cb->getDate(Date::WEEK))
|
||||
+ std::to_string(cb->getDate(Date::DAY_OF_WEEK));
|
||||
|
||||
cb->save("Saves/Autosave/" + prefix + "Autosave_" + id + "_" + stringifiedDate);
|
||||
cb->save("Saves/Autosave/" + prefix + "Autosave_" + stringifiedDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -284,6 +284,7 @@ bool CVCMIServer::prepareToStartGame()
|
||||
{
|
||||
case StartInfo::CAMPAIGN:
|
||||
logNetwork->info("Preparing to start new campaign");
|
||||
si->startTimeIso8601 = vstd::getDateTimeISO8601Basic(std::time(0));
|
||||
si->campState->setCurrentMap(campaignMap);
|
||||
si->campState->setCurrentMapBonus(campaignBonus);
|
||||
gh->init(si.get());
|
||||
@ -291,6 +292,7 @@ bool CVCMIServer::prepareToStartGame()
|
||||
|
||||
case StartInfo::NEW_GAME:
|
||||
logNetwork->info("Preparing to start new game");
|
||||
si->startTimeIso8601 = vstd::getDateTimeISO8601Basic(std::time(0));
|
||||
gh->init(si.get());
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user