From f1f23b09ae20fa4d6288a9139462e49ff77d98c4 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Wed, 25 Feb 2015 19:00:52 +0100 Subject: Added GetSnowStartHeight returns the height of a biome where it starts snowing --- src/BiomeDef.cpp | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) (limited to 'src/BiomeDef.cpp') diff --git a/src/BiomeDef.cpp b/src/BiomeDef.cpp index 188e06173..43f3ef0b1 100644 --- a/src/BiomeDef.cpp +++ b/src/BiomeDef.cpp @@ -222,3 +222,130 @@ bool IsBiomeCold(EMCSBiome a_Biome) + +int GetSnowStartHeight(EMCSBiome a_Biome) +{ + switch (a_Biome) + { + case biIcePlainsSpikes: + case biIcePlains: + case biIceMountains: + case biFrozenRiver: + case biColdBeach: + case biColdTaiga: + case biColdTaigaHills: + case biColdTaigaM: + { + // Always snow + return -1; + } + + case biExtremeHills: + case biExtremeHillsM: + case biExtremeHillsPlus: + case biExtremeHillsPlusM: + case biStoneBeach: + { + // Starts snowing at 96 + return 96; + } + + case biTaiga: + case biTaigaHills: + case biTaigaM: + { + // Start snowing at 130 + return 130; + } + + case biMegaTaiga: + case biMegaSpruceTaiga: + case biMegaTaigaHills: + case biMegaSpruceTaigaHills: + { + // Start snowing at 160 + return 160; + } + + case biRiver: + case biOcean: + case biDeepOcean: + { + // Starts snowing at 280 + return 280; + } + + case biBirchForest: + case biBirchForestHills: + case biBirchForestM: + case biBirchForestHillsM: + { + // Starts snowing at 335 + return 335; + } + + case biForest: + case biForestHills: + case biFlowerForest: + case biRoofedForest: + case biRoofedForestM: + { + // Starts snowing at 400 + return 400; + } + + case biPlains: + case biSunflowerPlains: + case biSwampland: + case biSwamplandM: + case biBeach: + { + // Starts snowing at 460 + return 460; + } + + case biMushroomIsland: + case biMushroomShore: + { + // Starts snowing at 520 + return 520; + } + + case biJungle: + case biJungleHills: + case biJungleM: + case biJungleEdge: + case biJungleEdgeM: + { + // Starts snowing at 550 + return 550; + } + + case biDesert: + case biDesertHills: + case biDesertM: + case biSavanna: + case biSavannaM: + case biSavannaPlateau: + case biSavannaPlateauM: + case biMesa: + case biMesaBryce: + case biMesaPlateau: + case biMesaPlateauF: + case biMesaPlateauFM: + case biMesaPlateauM: + { + // These biomes don't actualy have any downfall. + return 1000; + } + + default: + { + return -1; + } + } +} + + + + -- cgit v1.2.3 From 81e8577cfd9d1a8dd40ca1e9fc25c83f990b7f82 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Thu, 26 Feb 2015 20:26:45 +0100 Subject: changed int to unsigned And return 0 instead of -1 --- src/BiomeDef.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/BiomeDef.cpp') diff --git a/src/BiomeDef.cpp b/src/BiomeDef.cpp index 43f3ef0b1..bdc582863 100644 --- a/src/BiomeDef.cpp +++ b/src/BiomeDef.cpp @@ -223,7 +223,7 @@ bool IsBiomeCold(EMCSBiome a_Biome) -int GetSnowStartHeight(EMCSBiome a_Biome) +unsigned GetSnowStartHeight(EMCSBiome a_Biome) { switch (a_Biome) { @@ -237,7 +237,7 @@ int GetSnowStartHeight(EMCSBiome a_Biome) case biColdTaigaM: { // Always snow - return -1; + return 0; } case biExtremeHills: @@ -341,7 +341,7 @@ int GetSnowStartHeight(EMCSBiome a_Biome) default: { - return -1; + return 0; } } } -- cgit v1.2.3 From 224df08d30b556c0d7214e451fd4322ca75f32ea Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sat, 28 Feb 2015 17:27:28 +0100 Subject: GetSnowStartHeight returns an int --- src/BiomeDef.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/BiomeDef.cpp') diff --git a/src/BiomeDef.cpp b/src/BiomeDef.cpp index bdc582863..3e34ebdbe 100644 --- a/src/BiomeDef.cpp +++ b/src/BiomeDef.cpp @@ -223,7 +223,7 @@ bool IsBiomeCold(EMCSBiome a_Biome) -unsigned GetSnowStartHeight(EMCSBiome a_Biome) +int GetSnowStartHeight(EMCSBiome a_Biome) { switch (a_Biome) { -- cgit v1.2.3