Fixed generator upgrade leaving ghost stacks (size zero) when inserting fuel, fixes #448.

This commit is contained in:
Florian Nücke 2014-07-31 19:17:09 +02:00
parent 4c576a81f9
commit add56c98c5

View File

@ -54,7 +54,8 @@ class UpgradeGenerator(val owner: Container with Robot) extends component.Manage
case _ =>
inventory = Some(stack.splitStack(math.min(stack.stackSize, count)))
}
player.inventory.setInventorySlotContents(owner.selectedSlot, stack)
if (stack.stackSize > 0) player.inventory.setInventorySlotContents(owner.selectedSlot, stack)
else player.inventory.setInventorySlotContents(owner.selectedSlot, null)
result(true)
}