Implemented closing inventory if player is too far away.