CanMoveItem
Usage
- Return a non-null value to override default behavior
Example Autogenerated
csharp
private void CanMoveItem( Item item, PlayerInventory instance, ItemContainerId itemContainerId, int num, int num2, ItemMoveModifier itemMoveModifier )
{
Puts( "CanMoveItem works!" );
}
Location
- PlayerInventory::MoveItem(BaseEntity/RPCMessage msg)
csharp
//---
{
msg.player.ShowToast(GameTip.Styles.Error, PlayerInventoryErrors.InvalidItem, false, Array.Empty<string>());
ConstructionErrors.Log(msg.player, id.ToString());
return;
}
if (Interface.CallHook("CanMoveItem", item, this, itemContainerId, num, num2, itemMoveModifier) != null)
{
return;
}
BaseEntity entityOwner = item.GetEntityOwner();
if (entityOwner != null && entityOwner == msg.player && msg.player.IsRestrainedOrSurrendering)
//---