anchor.diff:  procedure TKMInfluences.AddAvoidBuilding(aX,aY: Word; aRad: Single; aValue: Byte = 255; aDecreasing: Boolean = False; aDecreaseSpeed: Single = 1);
   var
     X,Y: Integer;
  -  Dist, MaxDist: Single;
  +  SqrDist, SqrMaxDist: Single;
   begin
     if (aRad = 0) then
       Exit;
  -  MaxDist := Sqr(aRad);
  +  SqrMaxDist := Sqr(aRad);
     for Y := Max(aY - Ceil(aRad), 1) to Min(aY + Ceil(aRad), fMapY - 1) do
     for X := Max(aX - Ceil(aRad), 1) to Min(aX + Ceil(aRad), fMapX - 1) do
       if (AvoidBuilding[Y,X] = 0) OR (AvoidBuilding[Y,X] >= AVOID_BUILDING_FOREST_MINIMUM) then // Protect reservation tiles
       begin
  -      Dist := Sqr(aX-X) + Sqr(aY-Y);
  -      if (Dist <= MaxDist) then
  +      SqrDist := Sqr(aX-X) + Sqr(aY-Y);
  +      if (SqrDist <= SqrMaxDist) then
         begin
           if aDecreasing then
             //AvoidBuilding[Y,X] := Min(AvoidBuilding[Y,X] + Max(0, Round((1 - Dist * MaxDistInv) * aValue)), 255)
  -          AvoidBuilding[Y,X] := Min(AvoidBuilding[Y,X] + Max(0, Round(aValue - Dist * aDecreaseSpeed)), 255)
  +          AvoidBuilding[Y,X] := Min(AvoidBuilding[Y,X] + Max(0, Round(aValue - SqrDist * aDecreaseSpeed)), 255)
           else
             AvoidBuilding[Y,X] := Min(AvoidBuilding[Y,X] + aValue, 255);
         end;
  
positive.code:       //fAreas[Y,X] := Max(0, Min(255,cnt) * Byte(  gRes.Tileset.TileIsWalkable( gTerrain.Land[Y, X].Terrain )  ));
      end;
    end;
    //procedure InitNavMeshAreas();
    //var
    //  WAD: TKMWalkableAreasDetector;
  
negative.code:         Exit;
        end;
    end;
    // New AI does not use flood fill -> unreachable areas must be detected and building of houses must be avoided here
    procedure InitReachableArea();
    var
      PL: TKMHandIndex;
  