mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Inventory: Fix missing setModified calls
Previously inv:remove_item and inv:set_list did not trigger an inventory update
This commit is contained in:
parent
b53a60c8d5
commit
1d3f5af7c0
@ -685,6 +685,8 @@ ItemStack InventoryList::removeItem(const ItemStack &item)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!removed.empty())
|
||||||
|
setModified();
|
||||||
return removed;
|
return removed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -936,15 +938,18 @@ InventoryList * Inventory::addList(const std::string &name, u32 size)
|
|||||||
{
|
{
|
||||||
delete m_lists[i];
|
delete m_lists[i];
|
||||||
m_lists[i] = new InventoryList(name, size, m_itemdef);
|
m_lists[i] = new InventoryList(name, size, m_itemdef);
|
||||||
|
m_lists[i]->setModified();
|
||||||
}
|
}
|
||||||
return m_lists[i];
|
return m_lists[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//don't create list with invalid name
|
//don't create list with invalid name
|
||||||
if (name.find(' ') != std::string::npos) return NULL;
|
if (name.find(' ') != std::string::npos)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
InventoryList *list = new InventoryList(name, size, m_itemdef);
|
InventoryList *list = new InventoryList(name, size, m_itemdef);
|
||||||
|
list->setModified();
|
||||||
m_lists.push_back(list);
|
m_lists.push_back(list);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user