Replace p_ptr with player (+ fix one small bug)