mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Inventory: Send dirty lists where appropriate (#8742)
This change reduces the amount of sent data towards clients. Inventory lists that are already known to the player are skipped, saving quite some data over time. Raises protocol version to 38 to ensure correct backwards-compatible code.
This commit is contained in:
@@ -355,7 +355,7 @@ int ObjectRef::l_set_wielded_item(lua_State *L)
|
||||
ItemStack item = read_item(L, 2, getServer(L)->idef());
|
||||
bool success = co->setWieldedItem(item);
|
||||
if (success && co->getType() == ACTIVEOBJECT_TYPE_PLAYER) {
|
||||
getServer(L)->SendInventory(((PlayerSAO*)co));
|
||||
getServer(L)->SendInventory((PlayerSAO *)co, true);
|
||||
}
|
||||
lua_pushboolean(L, success);
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user