anchor.diff:  
   function TPathFindingAStarNew.HeapCmp(A, B: Pointer): Boolean;
   begin
  -  if A = nil then
  -    Result := True
  -  else
  -    Result := (B = nil) or (PANodeRec(A).Estim + PANodeRec(A).CostTo < PANodeRec(B).Estim + PANodeRec(B).CostTo);
  +  Result := (A = nil) or (B = nil) or (PANodeRec(A).Estim + PANodeRec(A).CostTo < PANodeRec(B).Estim + PANodeRec(B).CostTo);
   end;
   
   
   function TPathFindingAStarNew.MakeRoute: Boolean;
  -const c_closed = 65535;
  +const
  +  c_closed = 65535;
   var
     N: PANodeRec;
     X, Y: Word;
  
positive.code:             N.Estim := EstimateToFinish(X,Y);
              fHeap.Push(N);
            end
            else //If cell doen't meets Passability then mark it as Closed
              N.Estim := c_closed;
  
          end;
        end
        else //Else cell is old
        begin
  
          //Node N is valid. If route through new cell is shorter than previous
          if N.Estim <> c_closed then
          if CanWalkTo(KMPoint(fMinN.X, fMinN.Y), X, Y) then
  
negative.code: 
    while (fMinN <> nil) and not DestinationReached(fMinN.X, fMinN.Y) do
    begin
      fMinN.Estim := c_closed;
  
      //Check all surrounding cells and issue costs to them
      for Y := Max(fMinN.Y-1,1) to Min(fMinN.Y+1, gTerrain.MapY-1) do
      for X := Max(fMinN.X-1,1) to Min(fMinN.X+1, gTerrain.MapX-1) do
      begin
        N := @fOpenRef[Y,X];
        if N.RouteID <> fRouteID then //Cell is new
  