summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-11-27 21:19:52 +0100
committerMattes D <github@xoft.cz>2014-11-27 21:19:52 +0100
commite3e13f552fe717256e2ba4cb9bea7c00834d1ec4 (patch)
treefd5fd4968aba3e23c4cb8ece659b0afad19436ee /src
parentCMake: Fixed linux builds. (diff)
downloadcuberite-e3e13f552fe717256e2ba4cb9bea7c00834d1ec4.tar
cuberite-e3e13f552fe717256e2ba4cb9bea7c00834d1ec4.tar.gz
cuberite-e3e13f552fe717256e2ba4cb9bea7c00834d1ec4.tar.bz2
cuberite-e3e13f552fe717256e2ba4cb9bea7c00834d1ec4.tar.lz
cuberite-e3e13f552fe717256e2ba4cb9bea7c00834d1ec4.tar.xz
cuberite-e3e13f552fe717256e2ba4cb9bea7c00834d1ec4.tar.zst
cuberite-e3e13f552fe717256e2ba4cb9bea7c00834d1ec4.zip
Diffstat (limited to '')
-rw-r--r--src/BlockID.cpp2
-rw-r--r--src/BlockID.h2
-rw-r--r--src/Generating/ChunkGenerator.cpp6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/BlockID.cpp b/src/BlockID.cpp
index c98e0cad1..06f4232d3 100644
--- a/src/BlockID.cpp
+++ b/src/BlockID.cpp
@@ -200,7 +200,7 @@ public:
-BLOCKTYPE BlockStringToType(const AString & a_BlockTypeString)
+int BlockStringToType(const AString & a_BlockTypeString)
{
int res = atoi(a_BlockTypeString.c_str());
if ((res != 0) || (a_BlockTypeString.compare("0") == 0))
diff --git a/src/BlockID.h b/src/BlockID.h
index 24de2dc8a..8f2cee02e 100644
--- a/src/BlockID.h
+++ b/src/BlockID.h
@@ -1096,7 +1096,7 @@ class cIniFile;
// tolua_begin
/// Translates a blocktype string into blocktype. Takes either a number or an items.ini alias as input. Returns -1 on failure.
-extern BLOCKTYPE BlockStringToType(const AString & a_BlockTypeString);
+extern int BlockStringToType(const AString & a_BlockTypeString);
/// Translates an itemtype string into an item. Takes either a number, number^number, number:number or an items.ini alias as input. Returns true if successful.
extern bool StringToItem(const AString & a_ItemTypeString, cItem & a_Item);
diff --git a/src/Generating/ChunkGenerator.cpp b/src/Generating/ChunkGenerator.cpp
index 92e1bb31d..3ee02c767 100644
--- a/src/Generating/ChunkGenerator.cpp
+++ b/src/Generating/ChunkGenerator.cpp
@@ -191,13 +191,13 @@ EMCSBiome cChunkGenerator::GetBiomeAt(int a_BlockX, int a_BlockZ)
BLOCKTYPE cChunkGenerator::GetIniBlock(cIniFile & a_IniFile, const AString & a_SectionName, const AString & a_ValueName, const AString & a_Default)
{
AString BlockType = a_IniFile.GetValueSet(a_SectionName, a_ValueName, a_Default);
- BLOCKTYPE Block = BlockStringToType(BlockType);
+ int Block = BlockStringToType(BlockType);
if (Block < 0)
{
LOGWARN("[%s].%s Could not parse block value \"%s\". Using default: \"%s\".", a_SectionName.c_str(), a_ValueName.c_str(), BlockType.c_str(), a_Default.c_str());
- return BlockStringToType(a_Default);
+ return static_cast<BLOCKTYPE>(BlockStringToType(a_Default));
}
- return Block;
+ return static_cast<BLOCKTYPE>(Block);
}