summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol_1_8.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-06-06 18:22:42 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2021-06-28 22:54:21 +0200
commit04f02a675de1b788f5e5ed6e681828ea3e358df7 (patch)
tree9cc4c57cde889ef015b6cb5c85357ff9220a197e /src/Protocol/Protocol_1_8.cpp
parentSetBedPos: make World parameter non-null (diff)
downloadcuberite-04f02a675de1b788f5e5ed6e681828ea3e358df7.tar
cuberite-04f02a675de1b788f5e5ed6e681828ea3e358df7.tar.gz
cuberite-04f02a675de1b788f5e5ed6e681828ea3e358df7.tar.bz2
cuberite-04f02a675de1b788f5e5ed6e681828ea3e358df7.tar.lz
cuberite-04f02a675de1b788f5e5ed6e681828ea3e358df7.tar.xz
cuberite-04f02a675de1b788f5e5ed6e681828ea3e358df7.tar.zst
cuberite-04f02a675de1b788f5e5ed6e681828ea3e358df7.zip
Diffstat (limited to 'src/Protocol/Protocol_1_8.cpp')
-rw-r--r--src/Protocol/Protocol_1_8.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp
index 980348887..5c8ffd5df 100644
--- a/src/Protocol/Protocol_1_8.cpp
+++ b/src/Protocol/Protocol_1_8.cpp
@@ -252,12 +252,13 @@ void cProtocol_1_8_0::SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSetBlo
Pkt.WriteBEInt32(a_ChunkX);
Pkt.WriteBEInt32(a_ChunkZ);
Pkt.WriteVarInt32(static_cast<UInt32>(a_Changes.size()));
- for (sSetBlockVector::const_iterator itr = a_Changes.begin(), end = a_Changes.end(); itr != end; ++itr)
+
+ for (const auto & Change : a_Changes)
{
- Int16 Coords = static_cast<Int16>(itr->m_RelY | (itr->m_RelZ << 8) | (itr->m_RelX << 12));
+ Int16 Coords = static_cast<Int16>(Change.m_RelY | (Change.m_RelZ << 8) | (Change.m_RelX << 12));
Pkt.WriteBEInt16(Coords);
- Pkt.WriteVarInt32(static_cast<UInt32>(itr->m_BlockType & 0xFFF) << 4 | (itr->m_BlockMeta & 0xF));
- } // for itr - a_Changes[]
+ Pkt.WriteVarInt32(static_cast<UInt32>(Change.m_BlockType & 0xFFF) << 4 | (Change.m_BlockMeta & 0xF));
+ }
}