summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol17x.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-16 13:05:09 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-16 13:05:09 +0200
commitc5d00f3ec5acec908cd54b194a0042e0681764a5 (patch)
treee1f470ba8bb76f9c519ba5933e7e7c115ccb1ffd /src/Protocol/Protocol17x.cpp
parentFunction rename (diff)
downloadcuberite-c5d00f3ec5acec908cd54b194a0042e0681764a5.tar
cuberite-c5d00f3ec5acec908cd54b194a0042e0681764a5.tar.gz
cuberite-c5d00f3ec5acec908cd54b194a0042e0681764a5.tar.bz2
cuberite-c5d00f3ec5acec908cd54b194a0042e0681764a5.tar.lz
cuberite-c5d00f3ec5acec908cd54b194a0042e0681764a5.tar.xz
cuberite-c5d00f3ec5acec908cd54b194a0042e0681764a5.tar.zst
cuberite-c5d00f3ec5acec908cd54b194a0042e0681764a5.zip
Diffstat (limited to 'src/Protocol/Protocol17x.cpp')
-rw-r--r--src/Protocol/Protocol17x.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index d3b1cf946..6f46f8189 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -3016,8 +3016,11 @@ void cProtocol176::SendPlayerSpawn(const cPlayer & a_Player)
Pkt.WriteString(a_Player.GetClientHandle()->GetUUID());
Pkt.WriteString(a_Player.GetName());
- Pkt.WriteVarInt(m_Client->GetProperties().size());
- for (Json::Value::iterator itr = m_Client->GetProperties().begin(); itr != m_Client->GetProperties().end(); ++itr)
+ const Json::Value & Properties = m_Client->GetProperties();
+ const Json::Value::const_iterator End = Properties.end();
+ Pkt.WriteVarInt(Properties.size());
+
+ for (Json::Value::iterator itr = Properties.begin(); itr != End; ++itr)
{
Pkt.WriteString(((Json::Value)*itr).get("name", "").toStyledString());
Pkt.WriteString(((Json::Value)*itr).get("value", "").toStyledString());