diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2015-03-24 09:36:54 +0100 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2015-03-24 14:13:17 +0100 |
commit | 7851c4f7a2673477cf80a38842d77efbe5a0a915 (patch) | |
tree | bf061675545f6054aa8802d55549b951ec3eb0d7 /src/inventorymanager.cpp | |
parent | 9fbc3a8ca364922bc1129a35c1a37addab5f023c (diff) | |
download | minetest-7851c4f7a2673477cf80a38842d77efbe5a0a915.tar.gz minetest-7851c4f7a2673477cf80a38842d77efbe5a0a915.tar.bz2 minetest-7851c4f7a2673477cf80a38842d77efbe5a0a915.zip |
Don't send an InventoryAction at each setInventoryModified, we only need one SendInventory per inventory modification
Client doesn't like to receive multiples SendInventory for one action, this can trigger glitches on clients (sometimes due to incorrect UDP packet ordering due to UDP protocol)
This fix issue #2544
Diffstat (limited to 'src/inventorymanager.cpp')
-rw-r--r-- | src/inventorymanager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/inventorymanager.cpp b/src/inventorymanager.cpp index 26cabc25f..178985dfd 100644 --- a/src/inventorymanager.cpp +++ b/src/inventorymanager.cpp @@ -455,9 +455,9 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame } } - mgr->setInventoryModified(from_inv); + mgr->setInventoryModified(from_inv, false); if(inv_from != inv_to) - mgr->setInventoryModified(to_inv); + mgr->setInventoryModified(to_inv, false); } void IMoveAction::clientApply(InventoryManager *mgr, IGameDef *gamedef) @@ -597,7 +597,7 @@ void IDropAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame if(item2.count != actually_dropped_count) errorstream<<"Could not take dropped count of items"<<std::endl; - mgr->setInventoryModified(from_inv); + mgr->setInventoryModified(from_inv, false); } } |