I am trying to run an if statement where if an item can be stacked then it goes into the if statement, if it can not stack then it goes into the else statement.
The only thing is that whenever a stackable item comes into the if statement, CanStack always returns false.
Item randItem = ItemManager.CreateByName(listOfItems[rndm.Next(listOfItems.Length)]);
if (randItem.CanStack(randItem))
{
entity.GiveItem(randItem);
Server.Broadcast("Yup It Stacked.");
}
else
{
entity.GiveItem(randItem);
Server.Broadcast(randItem.CanStack(randItem).ToString());
}