anchor.diff:    end;
   
   // Generate balanced resources
  +  Resources := fRes.Resources;
     TileFloodSearch := TKMTileFloodSearch.Create(KMPoint(1,1), KMPoint(gTerrain.MapX-1,gTerrain.MapY-1), S, S2);
     try
       // Detect all shapes (merge / split existing shapes if they are / are not connected because could CA changed it)
  -    for I := Low(Resources) to High(Resources) do
  +    for I := 0 to fRes.Count - 1 do
       begin
         Resources[I].TileCounter := TIntegerArray.Create(0,0,0,0);
         K := Low(Resources[I].Points);
  
positive.code: constructor TKMRandomMapGenerator.Create();
  begin
    fRNG := TKMRandomNumberGenerator.Create;
  end;
  
  
  destructor TKMRandomMapGenerator.Destroy();
  begin
    fRNG.Free;
  end;
  
  
  
negative.code:       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
          Result := True;
        // Mark zero probability
        P[ActP.Y,ActP.X] := Probability;
        // Mark surrounding Voronoi shapes with 0 probability too
  