summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-03-06 11:08:47 +0100
committerHowaner <franzi.moos@googlemail.com>2014-03-06 11:08:47 +0100
commit99b9e6dce5ee49c1062074ce9f6d0669b2b265cc (patch)
tree3ac427304da9b1f2297391caa41cfaafb06240d8 /src
parentAdd SendBlockTo to cWorldInterface (diff)
downloadcuberite-99b9e6dce5ee49c1062074ce9f6d0669b2b265cc.tar
cuberite-99b9e6dce5ee49c1062074ce9f6d0669b2b265cc.tar.gz
cuberite-99b9e6dce5ee49c1062074ce9f6d0669b2b265cc.tar.bz2
cuberite-99b9e6dce5ee49c1062074ce9f6d0669b2b265cc.tar.lz
cuberite-99b9e6dce5ee49c1062074ce9f6d0669b2b265cc.tar.xz
cuberite-99b9e6dce5ee49c1062074ce9f6d0669b2b265cc.tar.zst
cuberite-99b9e6dce5ee49c1062074ce9f6d0669b2b265cc.zip
Diffstat (limited to '')
-rw-r--r--src/Inventory.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Inventory.cpp b/src/Inventory.cpp
index 7f434adfd..c7c089d5f 100644
--- a/src/Inventory.cpp
+++ b/src/Inventory.cpp
@@ -204,6 +204,12 @@ void cInventory::SetSlot(int a_SlotNum, const cItem & a_Item)
return;
}
Grid->SetSlot(GridSlotNum, a_Item);
+
+ // Broadcast the Equipped Item, if the Slot is changed.
+ if ((Grid == &m_HotbarSlots) && (m_EquippedSlotNum == (a_SlotNum - invHotbarOffset)))
+ {
+ m_Owner.GetWorld()->BroadcastEntityEquipment(m_Owner, 0, a_Item, m_Owner.GetClientHandle());
+ }
}