summaryrefslogtreecommitdiffstats
path: root/src/ChunkDef.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ChunkDef.h')
-rw-r--r--src/ChunkDef.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ChunkDef.h b/src/ChunkDef.h
index f4a0867b5..188ad33d8 100644
--- a/src/ChunkDef.h
+++ b/src/ChunkDef.h
@@ -116,15 +116,14 @@ public:
inline static Vector3i AbsoluteToRelative(Vector3i a_BlockPosition)
{
- int ChunkX, ChunkZ;
- BlockToChunk(a_BlockPosition.x, a_BlockPosition.z, ChunkX, ChunkZ);
+ cChunkCoords ChunckPos = BlockToChunk(a_BlockPosition);
- return {a_BlockPosition.x - ChunkX * Width, a_BlockPosition.y, a_BlockPosition.z - ChunkZ * Width};
+ return {a_BlockPosition.x - ChunckPos.m_ChunkX * Width, a_BlockPosition.y, a_BlockPosition.z - ChunckPos.m_ChunkZ * Width};
}
- inline static Vector3i AbsoluteToRelative(Vector3i a_BlockPosition, int a_ChunkX, int a_ChunkZ)
+ inline static Vector3i AbsoluteToRelative(Vector3i a_BlockPosition, cChunkCoords a_ChunkPos)
{
- return {a_BlockPosition.x - a_ChunkX * Width, a_BlockPosition.y, a_BlockPosition.z - a_ChunkZ * Width};
+ return {a_BlockPosition.x - a_ChunkPos.m_ChunkX * Width, a_BlockPosition.y, a_BlockPosition.z - a_ChunkPos.m_ChunkZ * Width};
}
/** Converts relative block coordinates into absolute coordinates with a known chunk location */