From 98aaa3239413ba58d6ada245b95aba87f6f02f18 Mon Sep 17 00:00:00 2001 From: "admin@omencraft.com" Date: Tue, 1 Nov 2011 23:05:47 +0000 Subject: Changed world gamemode location to world.ini for world based gamemodes. git-svn-id: http://mc-server.googlecode.com/svn/trunk@43 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cWorld.cpp | 6 ++++-- 1 file 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 +} -- cgit v1.2.3