summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-04 21:52:54 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-04 21:52:54 +0200
commitea49abd113050eb36fb85ac792cdab0e901b77e6 (patch)
treeee779c823cf4e48697fc7f175fd4244dfbbe2104 /src/World.cpp
parentHealth of monsters is now saved (diff)
downloadcuberite-ea49abd113050eb36fb85ac792cdab0e901b77e6.tar
cuberite-ea49abd113050eb36fb85ac792cdab0e901b77e6.tar.gz
cuberite-ea49abd113050eb36fb85ac792cdab0e901b77e6.tar.bz2
cuberite-ea49abd113050eb36fb85ac792cdab0e901b77e6.tar.lz
cuberite-ea49abd113050eb36fb85ac792cdab0e901b77e6.tar.xz
cuberite-ea49abd113050eb36fb85ac792cdab0e901b77e6.tar.zst
cuberite-ea49abd113050eb36fb85ac792cdab0e901b77e6.zip
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 345c894eb..739ae39d4 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -11,6 +11,7 @@
#include "ChunkMap.h"
#include "Generating/ChunkDesc.h"
#include "OSSupport/Timer.h"
+#include <sstream>
// Serializers
#include "WorldStorage/ScoreboardSerializer.h"
@@ -569,6 +570,11 @@ void cWorld::Start(void)
m_bUseChatPrefixes = IniFile.GetValueSetB("Mechanics", "UseChatPrefixes", true);
m_VillagersShouldHarvestCrops = IniFile.GetValueSetB("Monsters", "VillagersShouldHarvestCrops", true);
int GameMode = IniFile.GetValueSetI("General", "Gamemode", (int)m_GameMode);
+ int Weather = IniFile.GetValueSetI("General", "Weather", (int)m_Weather);
+
+ std::stringstream ss;
+ ss << m_TimeOfDay;
+ Int64 TimeOfDay = _atoi64(IniFile.GetValueSet("General", "TimeInTicks", ss.str()).c_str());
if ((GetDimension() != dimNether) && (GetDimension() != dimEnd))
{
@@ -581,6 +587,7 @@ void cWorld::Start(void)
// Adjust the enum-backed variables into their respective bounds:
m_GameMode = (eGameMode) Clamp(GameMode, (int)gmSurvival, (int)gmAdventure);
m_TNTShrapnelLevel = (eShrapnelLevel)Clamp(TNTShrapnelLevel, (int)slNone, (int)slAll);
+ m_Weather = (eWeather) Clamp(Weather, (int)wSunny, (int)wStorm);
switch (GetDimension())
{
@@ -759,6 +766,11 @@ void cWorld::Stop(void)
IniFile.SetValueI("Physics", "TNTShrapnelLevel", (int)m_TNTShrapnelLevel);
IniFile.SetValueB("Mechanics", "CommandBlocksEnabled", m_bCommandBlocksEnabled);
IniFile.SetValueB("Mechanics", "UseChatPrefixes", m_bUseChatPrefixes);
+ IniFile.SetValueI("General", "Weather", (int)m_Weather);
+
+ std::stringstream ss;
+ ss << m_TimeOfDay;
+ IniFile.SetValue("General", "TimeInTicks", ss.str());
IniFile.WriteFile(m_IniFileName);
m_TickThread.Stop();