Fixed path finding "bug"

Now the path is only recalculated when there are new blocking entities
in the world. Also, the grid is cleared so that cell distances are
always recalculated (this previously caused a bug)