From 5e24cb38ac22afa97fb62110f46813d85965d87c Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 17 Mar 2013 09:16:14 +0000 Subject: Fixed zero-probability height distribution in FluidSprings finisher FS #330 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1279 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Generating/FinishGen.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'source/Generating') diff --git a/source/Generating/FinishGen.cpp b/source/Generating/FinishGen.cpp index 8c13b6158..ab3d9488d 100644 --- a/source/Generating/FinishGen.cpp +++ b/source/Generating/FinishGen.cpp @@ -19,12 +19,12 @@ -#define DEF_NETHER_WATER_SPRINGS "0, 0; 255, 0" +#define DEF_NETHER_WATER_SPRINGS "0, 1; 255, 1" #define DEF_NETHER_LAVA_SPRINGS "0, 0; 30, 0; 31, 50; 120, 50; 127, 0" #define DEF_OVERWORLD_WATER_SPRINGS "0, 0; 10, 10; 11, 75; 16, 83; 20, 83; 24, 78; 32, 62; 40, 40; 44, 15; 48, 7; 56, 2; 64, 1; 255, 0" #define DEF_OVERWORLD_LAVA_SPRINGS "0, 0; 10, 5; 11, 45; 48, 2; 64, 1; 255, 0" -#define DEF_END_WATER_SPRINGS "0, 0; 255, 0" -#define DEF_END_LAVA_SPRINGS "0, 0; 255, 0" +#define DEF_END_WATER_SPRINGS "0, 1; 255, 1" +#define DEF_END_LAVA_SPRINGS "0, 1; 255, 1" @@ -684,7 +684,14 @@ cFinishGenFluidSprings::cFinishGenFluidSprings(int a_Seed, BLOCKTYPE a_Fluid, cI } } // switch (dimension) AString HeightDistribution = a_IniFile.GetValueSet(SectionName, "HeightDistribution", DefaultHeightDistribution); - m_HeightDistribution.SetDefString(HeightDistribution); + if (!m_HeightDistribution.SetDefString(HeightDistribution) || (m_HeightDistribution.GetSum() <= 0)) + { + LOGWARNING("[%sSprings]: HeightDistribution is invalid, using the default of \"%s\".", + (a_Fluid == E_BLOCK_WATER) ? "Water" : "Lava", + DefaultHeightDistribution.c_str() + ); + m_HeightDistribution.SetDefString(DefaultHeightDistribution); + } m_Chance = a_IniFile.GetValueSetI(SectionName, "Chance", DefaultChance); } -- cgit v1.2.3