diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-16 16:51:40 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-16 16:51:40 +0100 |
commit | cd2bb55176fb50c4b259d12b1fbb1a51fa5aecd9 (patch) | |
tree | 995a9e98579590b0f9c05d9fc706c44d81280ce5 | |
parent | Heightmap is properly generated after loading chunks now, so /spawn and /top should work properly again (diff) | |
download | cuberite-cd2bb55176fb50c4b259d12b1fbb1a51fa5aecd9.tar cuberite-cd2bb55176fb50c4b259d12b1fbb1a51fa5aecd9.tar.gz cuberite-cd2bb55176fb50c4b259d12b1fbb1a51fa5aecd9.tar.bz2 cuberite-cd2bb55176fb50c4b259d12b1fbb1a51fa5aecd9.tar.lz cuberite-cd2bb55176fb50c4b259d12b1fbb1a51fa5aecd9.tar.xz cuberite-cd2bb55176fb50c4b259d12b1fbb1a51fa5aecd9.tar.zst cuberite-cd2bb55176fb50c4b259d12b1fbb1a51fa5aecd9.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cPlayer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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;
}
|