From 3d66622772e66154b7624957a27f9be54c4c7c28 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Tue, 4 Dec 2018 20:37:48 +0100 Subject: Send only changed node metadata to clients instead of whole mapblock (#5268) Includes newer style changes and fixes by est31 Improve the block position de-serialization Add type NodeMetadataMap --- src/network/serverpackethandler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/network/serverpackethandler.cpp') diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index 8299ad002..329b38765 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -609,7 +609,9 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt) ma->to_inv.applyCurrentPlayer(player->getName()); setInventoryModified(ma->from_inv, false); - setInventoryModified(ma->to_inv, false); + if (ma->from_inv != ma->to_inv) { + setInventoryModified(ma->to_inv, false); + } bool from_inv_is_current_player = (ma->from_inv.type == InventoryLocation::PLAYER) && -- cgit v1.2.3