From 585571d78ca9ff5e384cae8d006a391df0f17ff7 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Mon, 13 Feb 2017 16:50:35 +0100 Subject: PieceGenerator: Added rotation-aware vertical connectors. --- src/Generating/PrefabPiecePool.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/Generating/PrefabPiecePool.cpp') diff --git a/src/Generating/PrefabPiecePool.cpp b/src/Generating/PrefabPiecePool.cpp index 407915e56..9c4e24e92 100644 --- a/src/Generating/PrefabPiecePool.cpp +++ b/src/Generating/PrefabPiecePool.cpp @@ -487,17 +487,23 @@ bool cPrefabPiecePool::ReadConnectorsCubesetVer1( break; } int Type = 0, RelX = 0, RelY = 0, RelZ = 0; - eBlockFace Direction = BLOCK_FACE_NONE; + AString DirectionStr; + cPiece::cConnector::eDirection Direction = cPiece::cConnector::dirYM; if ( !a_LuaState.GetNamedValue("Type", Type) || !a_LuaState.GetNamedValue("RelX", RelX) || !a_LuaState.GetNamedValue("RelY", RelY) || !a_LuaState.GetNamedValue("RelZ", RelZ) || - !a_LuaState.GetNamedValue("Direction", Direction) + !a_LuaState.GetNamedValue("Direction", DirectionStr) || + !cPiece::cConnector::StringToDirection(DirectionStr, Direction) ) { - CONDWARNING(a_LogWarnings, "Piece %s in file %s has a malformed Connector at index %d. Skipping the connector.", a_PieceName.c_str(), a_FileName.c_str(), idx); + CONDWARNING(a_LogWarnings, "Piece %s in file %s has a malformed Connector at index %d ({%d, %d, %d}, type %d, direction %s). Skipping the connector.", + a_PieceName.c_str(), a_FileName.c_str(), idx, RelX, RelY, RelZ, Type, DirectionStr.c_str() + ); res = false; + lua_pop(a_LuaState, 1); // stk: [Connectors] + idx += 1; continue; } a_Prefab->AddConnector(RelX, RelY, RelZ, Direction, Type); -- cgit v1.2.3