From cd2bb55176fb50c4b259d12b1fbb1a51fa5aecd9 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 16 Feb 2012 15:51:40 +0000 Subject: cPlayer empty-handed spawn fix git-svn-id: http://mc-server.googlecode.com/svn/trunk@275 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cPlayer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/cPlayer.cpp b/source/cPlayer.cpp index 5badb671f..f6a0d1fcc 100644 --- a/source/cPlayer.cpp +++ b/source/cPlayer.cpp @@ -148,7 +148,8 @@ cPacket * cPlayer::GetSpawnPacket(void) const SpawnPacket->m_PosZ = (int)(m_Pos.z * 32); SpawnPacket->m_Rotation = (char)((m_Rot.x / 360.f) * 256); SpawnPacket->m_Pitch = (char)((m_Rot.y / 360.f) * 256); - SpawnPacket->m_CurrentItem = (short)m_Inventory->GetEquippedItem().m_ItemID; + short ItemID = (short)m_Inventory->GetEquippedItem().m_ItemID; + SpawnPacket->m_CurrentItem = (ItemID > 0) ? ItemID : 0; // Unlike -1 in inventory, the named entity packet uses 0 for "none" return SpawnPacket; } -- cgit v1.2.3