diff options
author | andrew <xdotftw@gmail.com> | 2014-02-17 15:27:12 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-02-17 15:27:12 +0100 |
commit | 3b24bc870bb39a8b8812ed307250e1188b9ff788 (patch) | |
tree | 8b6cf830e06a0fe6bd1eb8769ba571f9316a4707 /src/Inventory.cpp | |
parent | cMap::UpdateRadius (diff) | |
download | cuberite-3b24bc870bb39a8b8812ed307250e1188b9ff788.tar cuberite-3b24bc870bb39a8b8812ed307250e1188b9ff788.tar.gz cuberite-3b24bc870bb39a8b8812ed307250e1188b9ff788.tar.bz2 cuberite-3b24bc870bb39a8b8812ed307250e1188b9ff788.tar.lz cuberite-3b24bc870bb39a8b8812ed307250e1188b9ff788.tar.xz cuberite-3b24bc870bb39a8b8812ed307250e1188b9ff788.tar.zst cuberite-3b24bc870bb39a8b8812ed307250e1188b9ff788.zip |
Diffstat (limited to 'src/Inventory.cpp')
-rw-r--r-- | src/Inventory.cpp | 25 |
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: |