From 489e3c03d0eb3c7e25b4dcbb98f9ad4f967a1977 Mon Sep 17 00:00:00 2001 From: Justin Aquadro Date: Sun, 22 Jul 2012 00:19:26 -0400 Subject: [PATCH] Fixed chunk relocation bug --- SubstrateCS/Source/ChunkRef.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SubstrateCS/Source/ChunkRef.cs b/SubstrateCS/Source/ChunkRef.cs index c56b9da..a96bd27 100644 --- a/SubstrateCS/Source/ChunkRef.cs +++ b/SubstrateCS/Source/ChunkRef.cs @@ -169,7 +169,10 @@ namespace Substrate public void SetLocation (int x, int z) { - ChunkRef c = _container.SetChunk(x, z, GetChunk()); + int relX = LocalX + (x - X); + int relZ = LocalZ + (z - Z); + + ChunkRef c = _container.SetChunk(relX, relZ, GetChunk()); _container = c._container; _cx = c._cx;