private void OnEquipRequested(PlayerEquipment equipment, ItemJar jar, ItemAsset asset, ref bool shouldAllow)
        {
            UnturnedPlayer player = GetUnturnedPlayer(equipment.player);

            UnturnedPlayerItemEquippingEvent @event = new UnturnedPlayerItemEquippingEvent(player, new UnturnedItem(jar.item));

            Emit(@event);

            shouldAllow = [email protected];
        }
Beispiel #2
0
        private void OnEquipRequested(PlayerEquipment equipment, ItemJar jar, ItemAsset asset, ref bool shouldAllow)
        {
            var player = GetUnturnedPlayer(equipment.player) !;

            var inventoryItem = new UnturnedInventoryItem(player.Inventory, jar);

            var @event = new UnturnedPlayerItemEquippingEvent(player, inventoryItem.Item)
            {
                IsCancelled = !shouldAllow
            };

            Emit(@event);

            shouldAllow = [email protected];
        }