summaryrefslogtreecommitdiffstats
path: root/src/Generating/PieceGenerator.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-05-10 21:27:57 +0200
committerMattes D <github@xoft.cz>2014-05-10 21:27:57 +0200
commit28815252e6ff086c0fab7cf56be4839f3d8612a3 (patch)
tree4532e85cbcc873a2616147713e9f899ecf84d111 /src/Generating/PieceGenerator.cpp
parentClient cert is not requested. (diff)
parentMerge pull request #993 from mc-server/GridStructGen (diff)
downloadcuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar
cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.gz
cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.bz2
cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.lz
cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.xz
cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.zst
cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.zip
Diffstat (limited to 'src/Generating/PieceGenerator.cpp')
-rw-r--r--src/Generating/PieceGenerator.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Generating/PieceGenerator.cpp b/src/Generating/PieceGenerator.cpp
index 8e9a48be6..ce19c1c95 100644
--- a/src/Generating/PieceGenerator.cpp
+++ b/src/Generating/PieceGenerator.cpp
@@ -339,9 +339,9 @@ cPlacedPiece * cPieceGenerator::PlaceStartingPiece(int a_BlockX, int a_BlockY, i
int NumRotations = 1;
for (size_t i = 1; i < ARRAYCOUNT(Rotations); i++)
{
- if (StartingPiece->CanRotateCCW(i))
+ if (StartingPiece->CanRotateCCW((int)i))
{
- Rotations[NumRotations] = i;
+ Rotations[NumRotations] = (int)i;
NumRotations += 1;
}
}
@@ -388,7 +388,8 @@ bool cPieceGenerator::TryPlacePieceAtConnector(
// Get a list of available connections:
const int * RotTable = DirectionRotationTable[a_Connector.m_Direction];
cConnections Connections;
- cPieces AvailablePieces = m_PiecePool.GetPiecesWithConnector(a_Connector.m_Type);
+ int WantedConnectorType = -a_Connector.m_Type;
+ cPieces AvailablePieces = m_PiecePool.GetPiecesWithConnector(WantedConnectorType);
Connections.reserve(AvailablePieces.size());
Vector3i ConnPos = a_Connector.m_Pos; // The position at which the new connector should be placed - 1 block away from the connector
AddFaceDirection(ConnPos.x, ConnPos.y, ConnPos.z, a_Connector.m_Direction);
@@ -406,7 +407,7 @@ bool cPieceGenerator::TryPlacePieceAtConnector(
cPiece::cConnectors Connectors = (*itrP)->GetConnectors();
for (cPiece::cConnectors::iterator itrC = Connectors.begin(), endC = Connectors.end(); itrC != endC; ++itrC)
{
- if (itrC->m_Type != a_Connector.m_Type)
+ if (itrC->m_Type != WantedConnectorType)
{
continue;
}