summaryrefslogtreecommitdiffstats
path: root/src/Inventory.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-03-07 14:45:45 +0100
committerMattes D <github@xoft.cz>2014-03-07 14:45:45 +0100
commitc1977035cfa6be57d50ec58aee7b5abe10b79ae7 (patch)
tree247b57eb23e423f934389190f17b44fdb261b99c /src/Inventory.cpp
parentRewound PolarSSL to master branch. (diff)
parentFix comment (diff)
downloadcuberite-c1977035cfa6be57d50ec58aee7b5abe10b79ae7.tar
cuberite-c1977035cfa6be57d50ec58aee7b5abe10b79ae7.tar.gz
cuberite-c1977035cfa6be57d50ec58aee7b5abe10b79ae7.tar.bz2
cuberite-c1977035cfa6be57d50ec58aee7b5abe10b79ae7.tar.lz
cuberite-c1977035cfa6be57d50ec58aee7b5abe10b79ae7.tar.xz
cuberite-c1977035cfa6be57d50ec58aee7b5abe10b79ae7.tar.zst
cuberite-c1977035cfa6be57d50ec58aee7b5abe10b79ae7.zip
Diffstat (limited to 'src/Inventory.cpp')
-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());
+ }
}