Example #1
0
        public bool UseItem(Humanoid user, ItemDrop.ItemData item)
        {
            Debug.Log($"Using item {item.m_shared.m_name}:{item.m_shared.m_itemType}");

            if (equipmentSlotManager.hasQueuedItem())
            {
                // stop clicking so fast
                return(false);
            }

            if (!this.CanAttach(item))
            {
                user.Message(MessageHud.MessageType.Center, "$ceko_piece_armorstand_cantattach", 0, null);
                return(true);
            }
            if (!this.m_nview.IsOwner())
            {
                this.m_nview.InvokeRPC("RequestOwn", Array.Empty <object>());
            }
            equipmentSlotManager.queuedItem = item;

            this.CancelInvoke("UpdateAttach");
            this.InvokeRepeating("UpdateAttach", 0.0f, 0.1f);
            return(true);
        }