Save player direction on close