Esempio n. 1
0
        public virtual void SpawnDelivery(Container pack)
        {
            if (!SpawnsDelivery || pack == null)
            {
                return;
            }

            var delivery = new List <Item>();

            for (var i = 0; i < Amount; ++i)
            {
                var item = Delivery.CreateEntityInstance <Item>();

                if (item != null)
                {
                    delivery.Add(item);

                    if (item.Stackable && Amount > 1)
                    {
                        item.Amount = Amount;
                        break;
                    }
                }
            }

            foreach (var item in delivery)
            {
                pack.DropItem(item); // Confirmed: on OSI items are added even if your pack is full
            }
        }