summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/cWorld.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/cWorld.cpp b/source/cWorld.cpp
index 1a8425476..a5f4bf1c3 100644
--- a/source/cWorld.cpp
+++ b/source/cWorld.cpp
@@ -117,6 +117,7 @@ cWorld::cWorld( const char* a_WorldName )
m_SpawnY = 128;
m_SpawnZ = (double)((rand()%10000)-5000);
m_WorldSeed = rand();
+ m_GameMode = 0;
cIniFile IniFile( m_pState->WorldName + "/world.ini");
if( IniFile.ReadFile() )
@@ -125,6 +126,7 @@ cWorld::cWorld( const char* a_WorldName )
m_SpawnY = IniFile.GetValueF("SpawnPosition", "Y", m_SpawnY );
m_SpawnZ = IniFile.GetValueF("SpawnPosition", "Z", m_SpawnZ );
m_WorldSeed = IniFile.GetValueI("Seed", "Seed", m_WorldSeed );
+ m_GameMode = IniFile.GetValueI("GameMode", "GameMode", m_GameMode );
}
else
{
@@ -132,6 +134,7 @@ cWorld::cWorld( const char* a_WorldName )
IniFile.SetValueF("SpawnPosition", "Y", m_SpawnY );
IniFile.SetValueF("SpawnPosition", "Z", m_SpawnZ );
IniFile.SetValueI("Seed", "Seed", m_WorldSeed );
+ IniFile.SetValueI("GameMode", "GameMode", m_GameMode );
if( !IniFile.WriteFile() )
{
LOG("WARNING: Could not write to %s/world.ini", a_WorldName);
@@ -176,7 +179,6 @@ cWorld::cWorld( const char* a_WorldName )
m_Time = 0;
m_WorldTimeFraction = 0.f;
m_WorldTime = 0;
- m_GameMode = 0;
m_LastSave = 0;
m_LastUnload = 0;
m_ClientHandleCriticalSection = new cCriticalSection();
@@ -802,4 +804,4 @@ void cWorld::AddToRemoveEntityQueue( cEntity & a_Entity )
const char* cWorld::GetName()
{
return m_pState->WorldName.c_str();
-} \ No newline at end of file
+}