summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorandrew <xdotftw@gmail.com>2014-02-14 15:21:16 +0100
committerandrew <xdotftw@gmail.com>2014-02-14 15:21:16 +0100
commit5b92b877bcc0c5072dbea98b6c54106f954aa758 (patch)
treefa91320608d925cac74804fd44597198e2f3760e /src/ClientHandle.cpp
parentIDCount Serialization (diff)
downloadcuberite-5b92b877bcc0c5072dbea98b6c54106f954aa758.tar
cuberite-5b92b877bcc0c5072dbea98b6c54106f954aa758.tar.gz
cuberite-5b92b877bcc0c5072dbea98b6c54106f954aa758.tar.bz2
cuberite-5b92b877bcc0c5072dbea98b6c54106f954aa758.tar.lz
cuberite-5b92b877bcc0c5072dbea98b6c54106f954aa758.tar.xz
cuberite-5b92b877bcc0c5072dbea98b6c54106f954aa758.tar.zst
cuberite-5b92b877bcc0c5072dbea98b6c54106f954aa758.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 8e44a61fd..a2cbaefff 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -1190,6 +1190,19 @@ void cClientHandle::HandleSlotSelected(short a_SlotNum)
{
m_Player->GetInventory().SetEquippedSlotNum(a_SlotNum);
m_Player->GetWorld()->BroadcastEntityEquipment(*m_Player, 0, m_Player->GetInventory().GetEquippedItem(), this);
+
+ const cItem & Item = m_Player->GetInventory().GetEquippedItem();
+ if (Item.m_ItemType == E_ITEM_MAP)
+ {
+ // TODO 2014-02-14 xdot: Do not hardcode this.
+ cMap * Map = m_Player->GetWorld()->GetMapData(Item.m_ItemDamage);
+
+ if (Map != NULL)
+ {
+ // TODO 2014-02-14 xdot: Optimization - Do not send the whole map.
+ Map->SendTo(*this);
+ }
+ }
}