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
This commit is contained in:
parent
bf2806dcb8
commit
98aaa32394
@ -117,6 +117,7 @@ cWorld::cWorld( const char* a_WorldName )
|
|||||||
m_SpawnY = 128;
|
m_SpawnY = 128;
|
||||||
m_SpawnZ = (double)((rand()%10000)-5000);
|
m_SpawnZ = (double)((rand()%10000)-5000);
|
||||||
m_WorldSeed = rand();
|
m_WorldSeed = rand();
|
||||||
|
m_GameMode = 0;
|
||||||
|
|
||||||
cIniFile IniFile( m_pState->WorldName + "/world.ini");
|
cIniFile IniFile( m_pState->WorldName + "/world.ini");
|
||||||
if( IniFile.ReadFile() )
|
if( IniFile.ReadFile() )
|
||||||
@ -125,6 +126,7 @@ cWorld::cWorld( const char* a_WorldName )
|
|||||||
m_SpawnY = IniFile.GetValueF("SpawnPosition", "Y", m_SpawnY );
|
m_SpawnY = IniFile.GetValueF("SpawnPosition", "Y", m_SpawnY );
|
||||||
m_SpawnZ = IniFile.GetValueF("SpawnPosition", "Z", m_SpawnZ );
|
m_SpawnZ = IniFile.GetValueF("SpawnPosition", "Z", m_SpawnZ );
|
||||||
m_WorldSeed = IniFile.GetValueI("Seed", "Seed", m_WorldSeed );
|
m_WorldSeed = IniFile.GetValueI("Seed", "Seed", m_WorldSeed );
|
||||||
|
m_GameMode = IniFile.GetValueI("GameMode", "GameMode", m_GameMode );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -132,6 +134,7 @@ cWorld::cWorld( const char* a_WorldName )
|
|||||||
IniFile.SetValueF("SpawnPosition", "Y", m_SpawnY );
|
IniFile.SetValueF("SpawnPosition", "Y", m_SpawnY );
|
||||||
IniFile.SetValueF("SpawnPosition", "Z", m_SpawnZ );
|
IniFile.SetValueF("SpawnPosition", "Z", m_SpawnZ );
|
||||||
IniFile.SetValueI("Seed", "Seed", m_WorldSeed );
|
IniFile.SetValueI("Seed", "Seed", m_WorldSeed );
|
||||||
|
IniFile.SetValueI("GameMode", "GameMode", m_GameMode );
|
||||||
if( !IniFile.WriteFile() )
|
if( !IniFile.WriteFile() )
|
||||||
{
|
{
|
||||||
LOG("WARNING: Could not write to %s/world.ini", a_WorldName);
|
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_Time = 0;
|
||||||
m_WorldTimeFraction = 0.f;
|
m_WorldTimeFraction = 0.f;
|
||||||
m_WorldTime = 0;
|
m_WorldTime = 0;
|
||||||
m_GameMode = 0;
|
|
||||||
m_LastSave = 0;
|
m_LastSave = 0;
|
||||||
m_LastUnload = 0;
|
m_LastUnload = 0;
|
||||||
m_ClientHandleCriticalSection = new cCriticalSection();
|
m_ClientHandleCriticalSection = new cCriticalSection();
|
||||||
@ -802,4 +804,4 @@ void cWorld::AddToRemoveEntityQueue( cEntity & a_Entity )
|
|||||||
const char* cWorld::GetName()
|
const char* cWorld::GetName()
|
||||||
{
|
{
|
||||||
return m_pState->WorldName.c_str();
|
return m_pState->WorldName.c_str();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user