summaryrefslogtreecommitdiffstats
path: root/src/Inventory.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-24 11:28:34 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-24 11:28:34 +0100
commitf77720c43f22e347ae9e66302a58b5e3f6a6de58 (patch)
tree06bb29a7e50aec777969ead2f5ccdf02393c9e1e /src/Inventory.cpp
parentRemoved an unused member variable from cChunk. (diff)
parentMaps: Improvements (diff)
downloadcuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar
cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.gz
cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.bz2
cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.lz
cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.xz
cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.zst
cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.zip
Diffstat (limited to 'src/Inventory.cpp')
-rw-r--r--src/Inventory.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Inventory.cpp b/src/Inventory.cpp
index 0e1cedc85..7f434adfd 100644
--- a/src/Inventory.cpp
+++ b/src/Inventory.cpp
@@ -515,6 +515,31 @@ bool cInventory::AddToBar( cItem & a_Item, const int a_Offset, const int a_Size,
+void cInventory::UpdateItems(void)
+{
+ const cItem & Slot = GetEquippedItem();
+
+ if (Slot.IsEmpty())
+ {
+ return;
+ }
+
+ switch (Slot.m_ItemType)
+ {
+ case E_ITEM_MAP:
+ {
+ ItemHandler(Slot.m_ItemType)->OnUpdate(m_Owner.GetWorld(), &m_Owner, Slot);
+ break;
+ }
+
+ default: break;
+ }
+}
+
+
+
+
+
void cInventory::SaveToJson(Json::Value & a_Value)
{
// The JSON originally included the 4 crafting slots and the result, so we have to put empty items there, too: