summaryrefslogtreecommitdiff
path: root/src/inventory.h
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-09-18 18:47:09 +0200
committerGitHub <noreply@github.com>2019-09-18 18:47:09 +0200
commit94a5df795c6d591042d8c29dc4548afdd1074190 (patch)
treed175b948298a948995ad6ceee8ca4144f9bdd2aa /src/inventory.h
parent05a7da627959afef2198f2036f4144e3d8abfbda (diff)
downloadminetest-94a5df795c6d591042d8c29dc4548afdd1074190.tar.gz
minetest-94a5df795c6d591042d8c29dc4548afdd1074190.tar.bz2
minetest-94a5df795c6d591042d8c29dc4548afdd1074190.zip
Inventory: Properly revert client predictions (#8945)
Caused by incremental inventory sending Previously everything was overwritten by serializing the entire inventory
Diffstat (limited to 'src/inventory.h')
-rw-r--r--src/inventory.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/inventory.h b/src/inventory.h
index b7a93553d..2828d3e5a 100644
--- a/src/inventory.h
+++ b/src/inventory.h
@@ -323,11 +323,14 @@ public:
return false;
}
- inline void setModified(bool dirty)
+ inline void setModified(bool dirty = true)
{
m_dirty = dirty;
- for (const auto &list : m_lists)
- list->setModified(dirty);
+ // Set all as handled
+ if (!dirty) {
+ for (const auto &list : m_lists)
+ list->setModified(dirty);
+ }
}
private:
// -1 if not found