mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 08:05:18 +02: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:
@@ -455,9 +455,9 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
|
||||
}
|
||||
}
|
||||
|
||||
mgr->setInventoryModified(from_inv);
|
||||
mgr->setInventoryModified(from_inv, false);
|
||||
if(inv_from != inv_to)
|
||||
mgr->setInventoryModified(to_inv);
|
||||
mgr->setInventoryModified(to_inv, false);
|
||||
}
|
||||
|
||||
void IMoveAction::clientApply(InventoryManager *mgr, IGameDef *gamedef)
|
||||
@@ -597,7 +597,7 @@ void IDropAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
|
||||
if(item2.count != actually_dropped_count)
|
||||
errorstream<<"Could not take dropped count of items"<<std::endl;
|
||||
|
||||
mgr->setInventoryModified(from_inv);
|
||||
mgr->setInventoryModified(from_inv, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user