anchor.diff:        if (FinP.Y <> ActP.Y) then ActP.Y := ActP.Y + Vector.Y;
         // If we detect zero chance (or almost zero) we reached existing connection and algoritm may end
         if (P[ ActP.Y,ActP.X ] < Probability) then
  -      begin
           Result := True;
  -        break;
  -      end;
         // Mark zero probability
         P[ActP.Y,ActP.X] := Probability;
         // Mark surrounding Voronoi shapes with 0 probability too
  
positive.code: var
    Shape: array of TLimitShape;
  // Search maximal and minimal values of each column in shape
    procedure MinerFixFloodSearch(const Resource: Byte; const Y,X: Integer; var aVisited: TBoolean2Array);
    begin
      if not aVisited[Y,X] AND (A[Y,X] = Resource) then
      begin
        aVisited[Y,X] := True;
        Shape[X].Active := True;
        if (Y >= Shape[X].Max) then
        begin
          Shape[X].Max := Y;
          if (A[Y+1,X] <> Resource) AND (A[Y+1,X] <> Byte(btCoal)) then
            A[Y+1,X] := 0;
        end;
        if (Y < Shape[X].Min) then
          Shape[X].Min := Y;
  
        if (Y < gTerrain.MapY-1) then MinerFixFloodSearch(Resource, Y+1,X, aVisited);
        if (Y > 1)               then MinerFixFloodSearch(Resource, Y-1,X, aVisited);
        if (X < gTerrain.MapX-1) then MinerFixFloodSearch(Resource, Y,X+1, aVisited);
        if (X > 1)               then MinerFixFloodSearch(Resource, Y,X-1, aVisited);
      end;
    end;
  
    procedure Fixer(MINESIZE, Resource, MineCnt: Byte; aPosition: TKMPoint; var aVisited: TBoolean2Array);
    var
  
negative.code:   RESOURCE: Byte;
    I, K: Integer;
    Visited: TBoolean2Array;
    Resources: TBalancedResource1Array;
  begin
    SetLength(Visited, gTerrain.MapY+1, gTerrain.MapX+1);
    for I := Low(Visited) to High(Visited) do
      for K := Low(Visited[I]) to High(Visited[I]) do
        Visited[I,K] := False;
  
    Resources := fRes.Resources;
    for I := 0 to fRes.Count - 1 do
    begin
      if (Resources[I].Resource = Byte(btGold)) then
        RESOURCE := 2
  