1
0

Map decorators; Map clients

This commit is contained in:
andrew
2014-02-18 20:50:08 +02:00
parent 3b24bc870b
commit 393ca0221d
12 changed files with 354 additions and 48 deletions

View File

@@ -1190,19 +1190,6 @@ 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);
}
}
}
@@ -2079,6 +2066,15 @@ void cClientHandle::SendMapColumn(int a_ID, int a_X, int a_Y, const Byte * a_Col
void cClientHandle::SendMapDecorators(int a_ID, const cMapDecoratorList & a_Decorators)
{
m_Protocol->SendMapDecorators(a_ID, a_Decorators);
}
void cClientHandle::SendMapInfo(int a_ID, unsigned int a_Scale)
{
m_Protocol->SendMapInfo(a_ID, a_Scale);