ソースを参照

fix light info is transmitted for wrong locations

Kolja Strohm 1 年間 前
コミット
d4f3b96799
1 ファイル変更2 行追加3 行削除
  1. 2 3
      FactoryCraft/Chunk.cpp

+ 2 - 3
FactoryCraft/Chunk.cpp

@@ -925,9 +925,8 @@ void Chunk::setLightData(
     Framework::Vec3<int> location, unsigned char* data, bool foreground)
 {
     int index
-        = ((location.x * CHUNK_SIZE + location.y) * WORLD_HEIGHT + location.z)
-        * 6;
-    memcpy(lightData + index, data, 6);
+        = (location.x * CHUNK_SIZE + location.y) * WORLD_HEIGHT + location.z;
+    memcpy(lightData + index * 6, data, 6);
     // check if neighbor is a visible block and send update to clients
     bool needSend = 0;
     for (int i = 0; i < 6; i++)