summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorSmallJoker <mk939@ymail.com>2019-08-25 09:46:54 +0200
committerSmallJoker <mk939@ymail.com>2019-08-25 09:46:54 +0200
commit1d3f5af7c060f989a5e2778a9117c6f7e1e88863 (patch)
tree22169a9ec0ca691aa9cc868f874cdd75ea59dcdf /src/inventory.cpp
parentb53a60c8d5757dc2298257d2c808f731697c05fd (diff)
downloadminetest-1d3f5af7c060f989a5e2778a9117c6f7e1e88863.tar.gz
minetest-1d3f5af7c060f989a5e2778a9117c6f7e1e88863.tar.bz2
minetest-1d3f5af7c060f989a5e2778a9117c6f7e1e88863.zip
Inventory: Fix missing setModified calls
Previously inv:remove_item and inv:set_list did not trigger an inventory update
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 375f0f147..02e122416 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -685,6 +685,8 @@ ItemStack InventoryList::removeItem(const ItemStack &item)
break;
}
}
+ if (!removed.empty())
+ setModified();
return removed;
}
@@ -936,15 +938,18 @@ InventoryList * Inventory::addList(const std::string &name, u32 size)
{
delete m_lists[i];
m_lists[i] = new InventoryList(name, size, m_itemdef);
+ m_lists[i]->setModified();
}
return m_lists[i];
}
//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);
+ list->setModified();
m_lists.push_back(list);
return list;
}