fix a crash in Player::distanceTo