summaryrefslogtreecommitdiffstats
path: root/src/BiomeDef.cpp
diff options
context:
space:
mode:
authordaniel0916 <theschokolps@gmail.com>2014-04-07 20:12:17 +0200
committerdaniel0916 <theschokolps@gmail.com>2014-04-07 20:12:17 +0200
commit2e9754ac1cf0537c12ab7974cf55c451c0724540 (patch)
tree713c5b8c8f22f77893b30b9c8cefca4a7c491483 /src/BiomeDef.cpp
parentFixed merge conflict (diff)
parentFixed some more minor issues with the redstone simulator. (diff)
downloadcuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.gz
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.bz2
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.lz
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.xz
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.zst
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.zip
Diffstat (limited to 'src/BiomeDef.cpp')
-rw-r--r--src/BiomeDef.cpp14
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;
}