anchor.diff:  end;
   
   
  -function TKMTerrain.EnsureVerticesRectWithinMap(const aRectF: TKMRectF; aInset: Single = 0): TKMRectF;
  +function TKMTerrain.EnsureVerticesRectWithinMap(const aRectF: TKMRectF; const aInset: Single = 0): TKMRectF;
   begin
     Result.Left   := EnsureRangeF(aRectF.Left,   aInset, fMapX - aInset);
     Result.Right  := EnsureRangeF(aRectF.Right,  aInset, fMapX - aInset);
  
positive.code: 
  {Ensure that requested tile is within Map boundaries}
  {X,Y are unsigned int, usually called from loops, hence no TKMPoint can be used}
  function TKMTerrain.EnsureTileInMapCoords(X,Y: Integer; aInset: Byte = 0): TKMPoint;
  begin
    Result.X := EnsureRange(X, 1 + aInset, fMapX - 1 - aInset);
    Result.Y := EnsureRange(Y, 1 + aInset, fMapY - 1 - aInset);
  end;
  
  
  procedure TKMTerrain.EnsureCoordsWithinMap(var X, Y: Single; aInset: Byte = 0);
  begin
    X := EnsureRange(X, 1 + aInset, fMapX - 1 - aInset);
    Y := EnsureRange(Y, 1 + aInset, fMapY - 1 - aInset);
  end;
  
  
  function TKMTerrain.EnsureTilesRectWithinMap(const aRectF: TKMRectF; aInset: Single = 0): TKMRectF;
  begin
    Result.Left   := EnsureRangeF(aRectF.Left,   1 + aInset, fMapX - 1 - aInset);
    Result.Right  := EnsureRangeF(aRectF.Right,  1 + aInset, fMapX - 1 - aInset);
  
negative.code:     function VertexUsageCompatible(const aLocFrom, aLocTo: TKMPoint): Boolean;
      function GetVertexUsageType(const aLocFrom, aLocTo: TKMPoint): TKMVertexUsage;
  
      function CoordsWithinMap(const X, Y: Single; const aInset: Byte = 0): Boolean; inline;
      function PointFInMapCoords(const aPointF: TKMPointF; const aInset: Byte = 0): Boolean; inline;
      function TileInMapCoords(const X, Y: Integer; const aInset: Byte): Boolean; overload; inline;
      function TileInMapCoords(const X, Y: Integer): Boolean; overload; inline;
      function TileInMapCoords(const aCell: TKMPoint; const Inset: Byte = 0): Boolean; overload; inline;
      function TileInMapCoords(const X,Y: Integer; const aInsetRect: TKMRect): Boolean; overload; inline;
      function VerticeInMapCoords(const X, Y: Integer; const aInset: Byte = 0): Boolean; overload; inline;
      function VerticeInMapCoords(const aCell: TKMPoint; const aInset: Byte = 0): Boolean; overload; inline;
      procedure EnsureCoordsWithinMap(var X, Y: Single; const aInset: Byte = 0); inline;
      function EnsureTilesRectWithinMap(const aRectF: TKMRectF; const aInset: Single = 0): TKMRectF; inline;
      function EnsureVerticesRectWithinMap(const aRectF: TKMRectF; const aInset: Single = 0): TKMRectF; inline;
      function EnsureTileInMapCoords(const X, Y: Integer; const aInset: Byte = 0): TKMPoint; overload; inline;
      function EnsureTileInMapCoords(const aLoc: TKMPoint; const aInset: Byte = 0): TKMPoint; overload; inline;
  
      function TileGoodForIronMine(X, Y: Word): Boolean;
      function TileGoodForGoldmine(X, Y: Word): Boolean;
  