allow to buy from full chest if there will be enough space

add input into chest after output has been removed

@erocs touched that part of the code last when he fixed the dupe bug, he should probably have a look since it's quite delicate