diff options
author | Mattes D <github@xoft.cz> | 2014-02-03 23:42:31 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-02-03 23:42:31 +0100 |
commit | 41b8315f534ae5888a08d0f3c0985e43e39be350 (patch) | |
tree | 0b6ecf1963f6e5b37aa1746d905fee80751b9c23 /src/BiomeDef.cpp | |
parent | Merge pull request #633 from mc-server/More_Sideways_Blocks (diff) | |
parent | Fogot to save Biogen (diff) | |
download | cuberite-41b8315f534ae5888a08d0f3c0985e43e39be350.tar cuberite-41b8315f534ae5888a08d0f3c0985e43e39be350.tar.gz cuberite-41b8315f534ae5888a08d0f3c0985e43e39be350.tar.bz2 cuberite-41b8315f534ae5888a08d0f3c0985e43e39be350.tar.lz cuberite-41b8315f534ae5888a08d0f3c0985e43e39be350.tar.xz cuberite-41b8315f534ae5888a08d0f3c0985e43e39be350.tar.zst cuberite-41b8315f534ae5888a08d0f3c0985e43e39be350.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..3fba93e8a 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 >= biFirstVariantBiome) && (res < biNumVariantBiomes)) + { + 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; } |