From 1b2f64473ed4f222d3b7f02df853730d4382105e Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Wed, 4 Mar 2015 11:29:34 +0100 Subject: Send Inventory packet on event, don't check it at each AsyncRunStep. * Call UpdateCrafting into SendInventory because this functions is only called before SendInventory * Use Player* instead of peer_id for UpdateCrafting because SendInventory already has the Player* pointer, then don't loop for searching Player* per peer_id * m_env_mutex don't need to be used with this modification because it's already locked before the calls --- src/network/packethandlers/server.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/network/packethandlers') diff --git a/src/network/packethandlers/server.cpp b/src/network/packethandlers/server.cpp index 2deede0ca..9dd1c95dd 100644 --- a/src/network/packethandlers/server.cpp +++ b/src/network/packethandlers/server.cpp @@ -1390,7 +1390,9 @@ void Server::handleCommand_Interact(NetworkPacket* pkt) // Placement was handled in lua // Apply returned ItemStack - playersao->setWieldedItem(item); + if (playersao->setWieldedItem(item)) { + SendInventory(pkt->getPeerId()); + } } // If item has node placement prediction, always send the -- cgit v1.2.3