summaryrefslogtreecommitdiffstats
path: root/src/Generating/Prefab.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2017-02-13 16:50:35 +0100
committerMattes D <github@xoft.cz>2017-02-13 16:50:35 +0100
commit585571d78ca9ff5e384cae8d006a391df0f17ff7 (patch)
treede5267740459c2b9b6b6a1296e9d43eb7ac8ec28 /src/Generating/Prefab.cpp
parentMade survival the default gamemode (#3563) (diff)
downloadcuberite-585571d78ca9ff5e384cae8d006a391df0f17ff7.tar
cuberite-585571d78ca9ff5e384cae8d006a391df0f17ff7.tar.gz
cuberite-585571d78ca9ff5e384cae8d006a391df0f17ff7.tar.bz2
cuberite-585571d78ca9ff5e384cae8d006a391df0f17ff7.tar.lz
cuberite-585571d78ca9ff5e384cae8d006a391df0f17ff7.tar.xz
cuberite-585571d78ca9ff5e384cae8d006a391df0f17ff7.tar.zst
cuberite-585571d78ca9ff5e384cae8d006a391df0f17ff7.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/Prefab.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Generating/Prefab.cpp b/src/Generating/Prefab.cpp
index e7d9ba711..de2f5f95d 100644
--- a/src/Generating/Prefab.cpp
+++ b/src/Generating/Prefab.cpp
@@ -299,7 +299,7 @@ void cPrefab::SetDefaultWeight(int a_DefaultWeight)
-void cPrefab::AddConnector(int a_RelX, int a_RelY, int a_RelZ, eBlockFace a_Direction, int a_Type)
+void cPrefab::AddConnector(int a_RelX, int a_RelY, int a_RelZ, cPiece::cConnector::eDirection a_Direction, int a_Type)
{
m_Connectors.push_back(cConnector(a_RelX, a_RelY, a_RelZ, a_Type, a_Direction));
}
@@ -390,7 +390,7 @@ void cPrefab::ParseConnectors(const char * a_ConnectorsDef)
{
continue;
}
- // Split into components: "Type: X, Y, Z: Face":
+ // Split into components: "Type: X, Y, Z: Direction":
AStringVector Defs = StringSplitAndTrim(*itr, ":");
if (Defs.size() != 3)
{
@@ -404,11 +404,11 @@ void cPrefab::ParseConnectors(const char * a_ConnectorsDef)
continue;
}
- // Check that the BlockFace is within range:
- int BlockFace = atoi(Defs[2].c_str());
- if ((BlockFace < 0) || (BlockFace >= 6))
+ // Check that the Direction is valid:
+ cPiece::cConnector::eDirection Direction;
+ if (!cPiece::cConnector::StringToDirection(Defs[2], Direction))
{
- LOGWARNING("Bad prefab Connector Blockface: \"%s\", skipping.", Defs[2].c_str());
+ LOGWARNING("Bad prefab Connector direction: \"%s\", skipping.", Defs[2].c_str());
continue;
}
@@ -416,7 +416,7 @@ void cPrefab::ParseConnectors(const char * a_ConnectorsDef)
m_Connectors.push_back(cPiece::cConnector(
atoi(Coords[0].c_str()), atoi(Coords[1].c_str()), atoi(Coords[2].c_str()), // Connector pos
atoi(Defs[0].c_str()), // Connector type
- static_cast<eBlockFace>(BlockFace)
+ Direction
));
} // for itr - Lines[]
}