mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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
This commit is contained in:
parent
038d3a31df
commit
1b2f64473e
7 changed files with 17 additions and 34 deletions
|
@ -90,14 +90,9 @@ ItemStack ServerActiveObject::getWieldedItem() const
|
|||
|
||||
bool ServerActiveObject::setWieldedItem(const ItemStack &item)
|
||||
{
|
||||
Inventory *inv = getInventory();
|
||||
if(inv)
|
||||
{
|
||||
InventoryList *list = inv->getList(getWieldList());
|
||||
if (list)
|
||||
{
|
||||
if(Inventory *inv = getInventory()) {
|
||||
if (InventoryList *list = inv->getList(getWieldList())) {
|
||||
list->changeItem(getWieldIndex(), item);
|
||||
setInventoryModified();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue