Skip to content

CanMoveItem

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private object CanMoveItem( Item item, PlayerInventory instance, ItemContainerId itemContainerId, int num, int num2, ItemMoveModifier itemMoveModifier )
{
    Puts( "CanMoveItem works!" );
    return null;
}

Location

  • PlayerInventory::MoveItem(BaseEntity.RPCMessage msg)
csharp
//---
		msg.player.ShowToast(GameTip.Styles.Error, PlayerInventoryErrors.InvalidItem, false);
		ConstructionErrors.Log(msg.player, id.ToString());
	}
	else
	{
		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)
//---

Released under the MIT License.