]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/inventory.cpp
map unloading is now a whole lot better
[dragonfireclient.git] / src / inventory.cpp
index 03df98de6fd2390db6bd5178ce06fbf9e194ebe5..fec51a759e581617db89f43eef9bb494ef82f949 100644 (file)
@@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "serverobject.h"
 #include "content_mapnode.h"
 #include "content_inventory.h"
+#include "content_sao.h"
 
 /*
        InventoryItem
@@ -470,7 +471,7 @@ InventoryItem * InventoryList::addItem(u32 i, InventoryItem *newitem)
        //setDirty(true);
        
        // If it is an empty position, it's an easy job.
-       InventoryItem *to_item = m_items[i];
+       InventoryItem *to_item = getItem(i);
        if(to_item == NULL)
        {
                m_items[i] = newitem;
@@ -502,7 +503,7 @@ InventoryItem * InventoryList::addItem(u32 i, InventoryItem *newitem)
 bool InventoryList::itemFits(u32 i, InventoryItem *newitem)
 {
        // If it is an empty position, it's an easy job.
-       InventoryItem *to_item = m_items[i];
+       InventoryItem *to_item = getItem(i);
        if(to_item == NULL)
        {
                return true;
@@ -528,7 +529,7 @@ InventoryItem * InventoryList::takeItem(u32 i, u32 count)
        
        //setDirty(true);
 
-       InventoryItem *item = m_items[i];
+       InventoryItem *item = getItem(i);
        // If it is an empty position, return NULL
        if(item == NULL)
                return NULL;