diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-02-03 21:26:17 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-02-03 21:26:17 +0100 |
commit | 80807eec2cc1c497c4766a0c7cddb9c3ddc29e45 (patch) | |
tree | 4655d0f74ce54797b73e4863c2df30134ea74763 /src/BiomeDef.cpp | |
parent | Merge pull request #623 from mc-server/tnt (diff) | |
download | cuberite-80807eec2cc1c497c4766a0c7cddb9c3ddc29e45.tar cuberite-80807eec2cc1c497c4766a0c7cddb9c3ddc29e45.tar.gz cuberite-80807eec2cc1c497c4766a0c7cddb9c3ddc29e45.tar.bz2 cuberite-80807eec2cc1c497c4766a0c7cddb9c3ddc29e45.tar.lz cuberite-80807eec2cc1c497c4766a0c7cddb9c3ddc29e45.tar.xz cuberite-80807eec2cc1c497c4766a0c7cddb9c3ddc29e45.tar.zst cuberite-80807eec2cc1c497c4766a0c7cddb9c3ddc29e45.zip |
Diffstat (limited to 'src/BiomeDef.cpp')
-rw-r--r-- | src/BiomeDef.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/BiomeDef.cpp b/src/BiomeDef.cpp index 89a1cdefb..5c1156484 100644 --- a/src/BiomeDef.cpp +++ b/src/BiomeDef.cpp @@ -13,8 +13,16 @@ EMCSBiome StringToBiome(const AString & a_BiomeString) int res = atoi(a_BiomeString.c_str()); if ((res != 0) || (a_BiomeString.compare("0") == 0)) { - // It was a valid number - return (EMCSBiome)res; + if(res >= biFirstBiome && res < biNumBiomes) + { + return (EMCSBiome)res; + } + else if(res >= biFirstVarientBiome && res < biNumVarientBiomes) + { + return (EMCSBiome)res; + } + // It was an invalid number + return biInvalidBiome; } // Convert using the built-in map: @@ -100,7 +108,7 @@ EMCSBiome StringToBiome(const AString & a_BiomeString) return BiomeMap[i].m_Biome; } } // for i - BiomeMap[] - return (EMCSBiome)-1; + return biInvalidBiome; } |