Browse Source

fix block update index in network message

Kolja Strohm 17 hours ago
parent
commit
b6ce21b314
1 changed files with 1 additions and 1 deletions
  1. 1 1
      FactoryCraft/Chunk.cpp

+ 1 - 1
FactoryCraft/Chunk.cpp

@@ -939,7 +939,7 @@ void Chunk::sendBlockInfo(Framework::Vec3<int> location)
     msg[0] = 0; // set block
     int typeId = blockIds[location.z] ? blockIds[location.z][index] : 0;
     *(unsigned short*)(msg + 1) = typeId;
-    *(int*)(msg + 3) = index;
+    *(int*)(msg + 3) = index * WORLD_HEIGHT + location.z;
     char state = 0;
     const BlockType* type = Game::INSTANCE->zBlockType(typeId);
     if (type->isFluid())