1
0

Send map when selected

This commit is contained in:
andrew
2014-02-14 16:21:16 +02:00
parent 32b465b8e1
commit 5b92b877bc
7 changed files with 117 additions and 30 deletions

View File

@@ -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);
}
}
}