anchor.diff:              if I in Tile.Layer[L].Corners then
                 Result[I] := gRes.Sprites.GetGenTerrainInfo(Tile.Layer[L].Terrain).TerKind;
         end;
  +  end;
   end;
   
   
  
positive.code: end;
  
  
  function TKMTerrainPainter.NodeInMapCoords(X,Y: Integer): Boolean;
  begin
    Result := InRange(X, 1, gTerrain.MapX) and InRange(Y, 1, gTerrain.MapY);
  end;
  
  
  //Skip the KaM data and load MapEd vertice info
  procedure TKMTerrainPainter.LoadFromFile(const aFileName: UnicodeString);
  var
  
negative.code:     //get 4 tiles around corner within map borders
      Rect := KMRect(aCell);                                            // x x  - we will get these x Tiles for corner 0, f.e.
      Rect := KMRectGrow(Rect, Dir);                                    // x o
      Rect := KMClipRect(Rect, 0, 0, gTerrain.MapX, gTerrain.MapY);     // Clip rect with possible nodes boundaries.
      RectCorners := KMRectCorners(Rect);                               //
      //after this preparation we will get 4 points (rect corners)
  
  