/// <summary> /// Takes half the units from a stack in a container slot. /// </summary> /// <param name="slot">The slot to take from</param> /// <returns>The units taken (may be null)</returns> public StackingModule TakeHalf(int slot) { StackingModule current = Storage[slot]; if (current != null) { if (current.Amount > 1) { return(current.TakeFromStack(current.Amount / 2)); } } return(Take(slot)); }