forked from Mirrorlandia_minetest/minetest
Inventory: Release resizes-locked lists on all on_
-callbacks
This commit is contained in:
parent
1a562ca144
commit
a464b41d99
@ -592,17 +592,22 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
|
||||
Report move to endpoints
|
||||
*/
|
||||
list_to.reset();
|
||||
list_from.reset();
|
||||
|
||||
// Source = destination => move
|
||||
if (from_inv == to_inv) {
|
||||
onMove(count, player);
|
||||
if (did_swap) {
|
||||
// Item is now placed in source list
|
||||
list_from = get_borrow_checked_invlist(inv_from, from_list);
|
||||
if (list_from) {
|
||||
src_item = list_from->getItem(from_i);
|
||||
list_from.reset();
|
||||
swapDirections();
|
||||
onMove(src_item.count, player);
|
||||
swapDirections();
|
||||
}
|
||||
}
|
||||
mgr->setInventoryModified(from_inv);
|
||||
} else {
|
||||
int src_item_count = src_item.count;
|
||||
@ -616,11 +621,15 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
|
||||
src_item.count = src_item_count;
|
||||
if (did_swap) {
|
||||
// Item is now placed in source list
|
||||
list_from = get_borrow_checked_invlist(inv_from, from_list);
|
||||
if (list_from) {
|
||||
src_item = list_from->getItem(from_i);
|
||||
list_from.reset();
|
||||
swapDirections();
|
||||
onPutAndOnTake(src_item, player);
|
||||
swapDirections();
|
||||
}
|
||||
}
|
||||
mgr->setInventoryModified(to_inv);
|
||||
mgr->setInventoryModified(from_inv);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user