Example #1
0
            public static void PostTellEquip(PlayerEquipment __instance, ushort __state, Transform[] ___thirdSlots,
                                             CSteamID steamID, ushort id)
            {
                if (!__instance.channel.checkServer(steamID))
                {
                    return;
                }

                if (___thirdSlots == null)
                {
                    return;
                }

                if (__state == 0 && id == 0)
                {
                    return;
                }

                if (__state != 0)
                {
                    OnItemUnequipped?.Invoke(__instance.player);
                }

                if (id != 0 && __instance.asset != null)
                {
                    var type = Assets.useableTypes.getType(__instance.asset.useable);

                    if (type != null && typeof(Useable).IsAssignableFrom(type))
                    {
                        OnItemEquipped?.Invoke(__instance.player);
                    }
                }
            }
Example #2
0
 private void UnequipFromInventory(Item item)
 {
     if (item is EquippableItem)
     {
         MoveItemToStorageInventory((EquippableItem)item);
         OnItemUnequipped?.Invoke((EquippableItem)item);
     }
 }
Example #3
0
            public static void PostTellEquip(PlayerEquipment __instance, ushort __state)
            {
                if (__state == 0 && __instance.itemID == 0)
                {
                    return;
                }

                if (__state != 0)
                {
                    OnItemUnequipped?.Invoke(__instance.player);
                }

                if (__instance.useable != null)
                {
                    OnItemEquipped?.Invoke(__instance.player);
                }
            }