summaryrefslogtreecommitdiffstats
path: root/source/cWorld.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-09 17:12:52 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-09 17:12:52 +0200
commita9350c43614cdc399aea5f517405066e5e18ac2a (patch)
tree84d44f1f40b0b86768a74c6b33e3f92dda99b550 /source/cWorld.cpp
parentSugarcane and cactus max height can be set in world.ini. (diff)
downloadcuberite-a9350c43614cdc399aea5f517405066e5e18ac2a.tar
cuberite-a9350c43614cdc399aea5f517405066e5e18ac2a.tar.gz
cuberite-a9350c43614cdc399aea5f517405066e5e18ac2a.tar.bz2
cuberite-a9350c43614cdc399aea5f517405066e5e18ac2a.tar.lz
cuberite-a9350c43614cdc399aea5f517405066e5e18ac2a.tar.xz
cuberite-a9350c43614cdc399aea5f517405066e5e18ac2a.tar.zst
cuberite-a9350c43614cdc399aea5f517405066e5e18ac2a.zip
Diffstat (limited to '')
-rw-r--r--source/cWorld.cpp49
1 files changed, 20 insertions, 29 deletions
diff --git a/source/cWorld.cpp b/source/cWorld.cpp
index 1cac3633b..07ca7a0d1 100644
--- a/source/cWorld.cpp
+++ b/source/cWorld.cpp
@@ -243,36 +243,27 @@ cWorld::cWorld( const AString & a_WorldName )
AString StorageSchema("Default");
cIniFile IniFile(m_IniFileName);
- if (IniFile.ReadFile())
- {
- m_SpawnX = IniFile.GetValueF("SpawnPosition", "X", m_SpawnX);
- m_SpawnY = IniFile.GetValueF("SpawnPosition", "Y", m_SpawnY);
- m_SpawnZ = IniFile.GetValueF("SpawnPosition", "Z", m_SpawnZ);
- m_GameMode = (eGameMode)IniFile.GetValueI("GameMode", "GameMode", m_GameMode );
- StorageSchema = IniFile.GetValue("Storage", "Schema", StorageSchema);
- m_MaxCactusHeight = IniFile.GetValueI("Plants", "MaxCactusHeight", 3);
- m_MaxSugarcaneHeight = IniFile.GetValueI("Plants", "MaxSugarcaneHeight", 3);
- m_IsCropsBonemealable = IniFile.GetValueB("Plants", "IsCropsBonemealable", true);
- m_IsGrassBonemealable = IniFile.GetValueB("Plants", "IsGrassBonemealable", true);
- m_IsSaplingBonemealable = IniFile.GetValueB("Plants", "IsSaplingBonemealable", true);
- m_IsMelonStemBonemealable = IniFile.GetValueB("Plants", "IsMelonStemBonemealable", true);
- m_IsMelonBonemealable = IniFile.GetValueB("Plants", "IsMelonBonemealable", false);
- m_IsPumpkinStemBonemealable = IniFile.GetValueB("Plants", "IsPumpkinStemBonemealable", true);
- m_IsPumpkinBonemealable = IniFile.GetValueB("Plants", "IsPumpkinBonemealable", false);
- m_IsSugarcaneBonemealable = IniFile.GetValueB("Plants", "IsSugarcaneBonemealable", false);
- m_IsCactusBonemealable = IniFile.GetValueB("Plants", "IsCactusBonemealable", false);
- }
- else
+ m_SpawnX = IniFile.GetValueF ("SpawnPosition", "X", m_SpawnX);
+ m_SpawnY = IniFile.GetValueF ("SpawnPosition", "Y", m_SpawnY);
+ m_SpawnZ = IniFile.GetValueF ("SpawnPosition", "Z", m_SpawnZ);
+ StorageSchema = IniFile.GetValue ("Storage", "Schema", StorageSchema);
+ m_MaxCactusHeight = IniFile.GetValueSetI("Plants", "MaxCactusHeight", 3);
+ m_MaxSugarcaneHeight = IniFile.GetValueSetI("Plants", "MaxSugarcaneHeight", 3);
+ m_IsCropsBonemealable = IniFile.GetValueSetB("Plants", "IsCropsBonemealable", true);
+ m_IsGrassBonemealable = IniFile.GetValueSetB("Plants", "IsGrassBonemealable", true);
+ m_IsSaplingBonemealable = IniFile.GetValueSetB("Plants", "IsSaplingBonemealable", true);
+ m_IsMelonStemBonemealable = IniFile.GetValueSetB("Plants", "IsMelonStemBonemealable", true);
+ m_IsMelonBonemealable = IniFile.GetValueSetB("Plants", "IsMelonBonemealable", false);
+ m_IsPumpkinStemBonemealable = IniFile.GetValueSetB("Plants", "IsPumpkinStemBonemealable", true);
+ m_IsPumpkinBonemealable = IniFile.GetValueSetB("Plants", "IsPumpkinBonemealable", false);
+ m_IsSugarcaneBonemealable = IniFile.GetValueSetB("Plants", "IsSugarcaneBonemealable", false);
+ m_IsCactusBonemealable = IniFile.GetValueSetB("Plants", "IsCactusBonemealable", false);
+
+ m_GameMode = (eGameMode)IniFile.GetValueI("GameMode", "GameMode", m_GameMode );
+
+ if (!IniFile.WriteFile())
{
- IniFile.SetValueF("SpawnPosition", "X", m_SpawnX );
- IniFile.SetValueF("SpawnPosition", "Y", m_SpawnY );
- IniFile.SetValueF("SpawnPosition", "Z", m_SpawnZ );
- IniFile.SetValueI("GameMode", "GameMode", m_GameMode );
- IniFile.SetValue("Storage", "Schema", StorageSchema);
- if( !IniFile.WriteFile() )
- {
- LOG("WARNING: Could not write to %s", m_IniFileName.c_str());
- }
+ LOG("WARNING: Could not write to %s", m_IniFileName.c_str());
}
m_Lighting.Start(this);