summaryrefslogtreecommitdiffstats
path: root/source/ChestEntity.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/ChestEntity.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/ChestEntity.cpp b/source/ChestEntity.cpp
index aad8844c6..dbd7f6ef2 100644
--- a/source/ChestEntity.cpp
+++ b/source/ChestEntity.cpp
@@ -100,10 +100,10 @@ void cChestEntity::SaveToJson(Json::Value & a_Value)
a_Value["z"] = m_PosZ;
Json::Value AllSlots;
- for (int i = m_Contents.GetNumSlots(); i >= 0; i--)
+ for (int i = m_Contents.GetNumSlots() - 1; i >= 0; i--)
{
Json::Value Slot;
- m_Contents.GetItem(i).GetJson(Slot);
+ m_Contents.GetSlot(i).GetJson(Slot);
AllSlots.append(Slot);
}
a_Value["Slots"] = AllSlots;