mirror of
https://github.com/minetest/minetest.git
synced 2025-07-01 23:50:22 +02:00
Added files via upload
This commit is contained in:
@ -523,6 +523,43 @@ void IMoveAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
|
||||
}
|
||||
}
|
||||
|
||||
InventoryLocation from_loc;
|
||||
if(from_inv.type == InventoryLocation::NODEMETA)
|
||||
{
|
||||
from_loc.setNodeMeta(from_inv.p);
|
||||
}
|
||||
else if(from_inv.type == InventoryLocation::DETACHED)
|
||||
{
|
||||
from_loc.setDetached(from_inv.name);
|
||||
}
|
||||
else if(from_inv.type == InventoryLocation::PLAYER)
|
||||
{
|
||||
from_loc.setPlayer(from_inv.name);
|
||||
}
|
||||
else if(from_inv.type == InventoryLocation::UNDEFINED)
|
||||
{
|
||||
from_loc.setUndefined();
|
||||
}
|
||||
|
||||
InventoryLocation to_loc;
|
||||
if(to_inv.type == InventoryLocation::NODEMETA)
|
||||
{
|
||||
to_loc.setNodeMeta(to_inv.p);
|
||||
}
|
||||
else if(to_inv.type == InventoryLocation::DETACHED)
|
||||
{
|
||||
to_loc.setDetached(to_inv.name);
|
||||
}
|
||||
else if(to_inv.type == InventoryLocation::PLAYER)
|
||||
{
|
||||
to_loc.setPlayer(to_inv.name);
|
||||
}
|
||||
else if(to_inv.type == InventoryLocation::UNDEFINED)
|
||||
{
|
||||
to_loc.setUndefined();
|
||||
}
|
||||
PLAYER_TO_SA(player)->on_inventory_move_item(from_loc, from_list, from_i, to_loc, to_list, to_i, src_item, count, player);
|
||||
|
||||
mgr->setInventoryModified(from_inv, false);
|
||||
if(inv_from != inv_to)
|
||||
mgr->setInventoryModified(to_inv, false);
|
||||
@ -698,6 +735,9 @@ void IDropAction::apply(InventoryManager *mgr, ServerActiveObject *player, IGame
|
||||
from_inv.p, from_list, from_i, src_item, player);
|
||||
}
|
||||
|
||||
// Report drop to registered listeners
|
||||
PLAYER_TO_SA(player)->on_inventory_drop_item(from_inv, from_list, from_i, src_item, player,player->getBasePosition() + v3f(0,1,0));
|
||||
|
||||
/*
|
||||
Record rollback information
|
||||
*/
|
||||
|
Reference in New Issue
Block a user