1
0

World: Remember the age persistently. (#3556)

This commit is contained in:
Mattes D
2017-01-19 22:45:23 +01:00
committed by GitHub
parent dfa8f278ea
commit 97980d1103
2 changed files with 8 additions and 2 deletions

View File

@@ -471,6 +471,8 @@ void cWorld::Start(cDeadlockDetect & a_DeadlockDetect)
int GameMode = IniFile.GetValueSetI("General", "Gamemode", static_cast<int>(m_GameMode));
int Weather = IniFile.GetValueSetI("General", "Weather", static_cast<int>(m_Weather));
m_WorldAge = std::chrono::milliseconds(IniFile.GetValueSetI("General", "WorldAgeMS", 0LL));
// Load the weather frequency data:
if (m_Dimension == dimOverworld)
{
@@ -937,6 +939,7 @@ void cWorld::Stop(cDeadlockDetect & a_DeadlockDetect)
IniFile.SetValueB("General", "IsDaylightCycleEnabled", m_IsDaylightCycleEnabled);
IniFile.SetValueI("General", "Weather", static_cast<int>(m_Weather));
IniFile.SetValueI("General", "TimeInTicks", GetTimeOfDay());
IniFile.SetValueI("General", "WorldAgeMS", static_cast<Int64>(m_WorldAge.count()));
IniFile.WriteFile(m_IniFileName);
m_TickThread.Stop();