1
0
Fork 0

cInventory: Add listener to shield slot. (#4095)

This commit is contained in:
peterbell10 2017-12-21 11:55:23 +00:00 committed by Alexander Harkness
parent 532731e6f4
commit e0ff5f5639
1 changed files with 6 additions and 0 deletions

View File

@ -28,6 +28,7 @@ cInventory::cInventory(cPlayer & a_Owner) :
m_ArmorSlots.AddListener(*this); m_ArmorSlots.AddListener(*this);
m_InventorySlots.AddListener(*this); m_InventorySlots.AddListener(*this);
m_HotbarSlots.AddListener(*this); m_HotbarSlots.AddListener(*this);
m_ShieldSlots.AddListener(*this);
SetEquippedSlotNum(0); SetEquippedSlotNum(0);
} }
@ -792,6 +793,11 @@ void cInventory::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum)
{ {
Base = invHotbarOffset; Base = invHotbarOffset;
} }
else if (a_ItemGrid = &m_ShieldSlots)
{
Base = invShieldOffset;
}
else else
{ {
ASSERT(!"Unknown ItemGrid calling OnSlotChanged()"); ASSERT(!"Unknown ItemGrid calling OnSlotChanged()");