Fix infinite loop when chopping tree into planks with full inventory.