Aura.Channel.World.Inventory.CreatureInventory.InsertStacks C# (CSharp) 메소드

InsertStacks() 공개 메소드

Adds new stacks to the inventory until the amount was added, using temp as fallback. Returns false if something went wrong, and not everything could be added.
public InsertStacks ( int itemId, int amount ) : bool
itemId int Id of the item to add.
amount int Amount to add, value affects the amount of stacks.
리턴 bool
		public bool InsertStacks(int itemId, int amount)
		{
			if (amount < 0)
				return false;

			// Insert new stacks till amount is 0.
			do
			{
				var stackItem = new Item(itemId);
				var stackAmount = Math.Min(stackItem.Data.StackMax, amount);

				stackItem.Amount = stackAmount;
				amount -= stackAmount;

				if (!this.Insert(stackItem, true))
					return false;
			}
			while (amount > 0);

			return true;
		}