示例#1
0
        private void OnPlayerLootEnd(PlayerLoot inventory)
        {
            BasePlayer player = inventory.GetComponent <BasePlayer>();

            if (bountyCreator.ContainsKey(player.userID))
            {
                StorageContainer container = inventory.entitySource.GetComponent <StorageContainer>();
                if (container != null)
                {
                    if (container.inventory.itemList.Count == 0)
                    {
                        SendReply(player, msg("no_items_deposited", player.userID));
                    }
                    else
                    {
                        CreateNewBounty(player, bountyCreator[player.userID], 0, 0, container.inventory);
                    }

                    openContainers.Remove(container);
                    ClearContainer(container.inventory);
                    container.DieInstantly();
                }
                bountyCreator.Remove(player.userID);
            }
        }
            private void DestroyLoot(BaseEntity entity)
            {
                if (entity == null)
                {
                    return;
                }

                StorageContainer container = entity.GetComponent <StorageContainer>();

                if (container != null)
                {
                    ins.ClearContainer(entity);
                    container.DieInstantly();
                }

                JunkPile junkPile = entity.GetComponent <JunkPile>();

                if (junkPile != null)
                {
                    for (int y = 0; y < junkPile.spawngroups.Length; y++)
                    {
                        junkPile.spawngroups[y].Clear();
                    }
                    junkPile.SinkAndDestroy();
                }
            }