From 5b92b877bcc0c5072dbea98b6c54106f954aa758 Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 14 Feb 2014 16:21:16 +0200 Subject: Send map when selected --- src/ClientHandle.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/ClientHandle.cpp') 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); + } + } } -- cgit v1.2.3