added flag to set max range as infinity (used for cost map clearing)