mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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
This commit is contained in:
parent
9fbc3a8ca3
commit
7851c4f7a2
5 changed files with 15 additions and 10 deletions
|
@ -952,8 +952,8 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
|
|||
ma->from_inv.applyCurrentPlayer(player->getName());
|
||||
ma->to_inv.applyCurrentPlayer(player->getName());
|
||||
|
||||
setInventoryModified(ma->from_inv);
|
||||
setInventoryModified(ma->to_inv);
|
||||
setInventoryModified(ma->from_inv, false);
|
||||
setInventoryModified(ma->to_inv, false);
|
||||
|
||||
bool from_inv_is_current_player =
|
||||
(ma->from_inv.type == InventoryLocation::PLAYER) &&
|
||||
|
@ -1006,7 +1006,7 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
|
|||
|
||||
da->from_inv.applyCurrentPlayer(player->getName());
|
||||
|
||||
setInventoryModified(da->from_inv);
|
||||
setInventoryModified(da->from_inv, false);
|
||||
|
||||
/*
|
||||
Disable dropping items out of craftpreview
|
||||
|
@ -1033,7 +1033,7 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
|
|||
|
||||
ca->craft_inv.applyCurrentPlayer(player->getName());
|
||||
|
||||
setInventoryModified(ca->craft_inv);
|
||||
setInventoryModified(ca->craft_inv, false);
|
||||
|
||||
//bool craft_inv_is_current_player =
|
||||
// (ca->craft_inv.type == InventoryLocation::PLAYER) &&
|
||||
|
@ -1052,6 +1052,8 @@ void Server::handleCommand_InventoryAction(NetworkPacket* pkt)
|
|||
a->apply(this, playersao, this);
|
||||
// Eat the action
|
||||
delete a;
|
||||
|
||||
SendInventory(playersao);
|
||||
}
|
||||
|
||||
void Server::handleCommand_ChatMessage(NetworkPacket* pkt)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue