anchor.diff:  
     TKMTerrainTileBrief = record
       X,Y: Byte;
  -    Terrain: Byte;
  -    Rotation: Byte;
  -    Height: Byte;
  -    Obj: Byte;
  -    ChangeSet: TKMTileChangeTypeSet;
  -  end;
  -
  -  TKMTerrainTileChangeError = packed record
  -    X, Y: Byte;
  -    ErrorsIn: TKMTileChangeTypeSet;
  -  end;
  -
  -  TKMTerrainTileChangeErrorArray = array of TKMTerrainTileChangeError;
  -
  +    Terrain: Byte;
  +    Rotation: Byte;
  +    Height: Byte;
  +    Obj: Byte;
  +    ChangeSet: TKMTileChangeTypeSet;
  +  end;
  +
  +  TKMTerrainTileChangeError = packed record
  +    X, Y: Byte;
  +    ErrorsIn: TKMTileChangeTypeSet;
  +  end;
  +
  +  TKMTerrainTileChangeErrorArray = array of TKMTerrainTileChangeError;
  +
     TKMTerrainTile = record
       Terrain: Byte;
       Height: Byte;
  
positive.code:     ErrorTypesOnTile: TKMTileChangeTypeSet;
  begin
    Result := True;
    if Length(aTiles) = 0 then Exit;
  
    //Initialization
    DiagonalChangedTotal := False;
    Rect := KMRECT_INVALID_TILES;
    // Use separate HeightRect, because UpdateLight invoked only when Height is changed
    HeightRect := KMRECT_INVALID_TILES;
    ErrCnt := 0;
  
    // make backup copy of Land only if we may need revert changes
    if aRevertOnFail then
    begin
      SetLength(BackupLand, fMapY, fMapX);
      for I := 1 to fMapY do
        for J := 1 to fMapX do
          BackupLand[I-1][J-1] := Land[I, J];
    end;
  
    for I := 0 to High(aTiles) do
    begin
      T := aTiles[I];
  
      HasErrorOnTile := False;
      ErrorTypesOnTile := [];
  
      if TileInMapCoords(T.X, T.Y) then
      //if InRange(T.X, 2, fMapX - 2) and InRange(T.Y, 2, fMapY - 2) then
      begin
        // Update terrain and rotation if needed
        if tctTerrain in T.ChangeSet then
        begin
          if InRange(T.Rotation, 0, 3) then
          begin
            if TrySetTile(T.X, T.Y, T.Terrain, T.Rotation, False) then
              UpdateRect(Rect, T.X, T.Y)
            else
              SetErrorNSetResult(tctTerrain, HasErrorOnTile, ErrorTypesOnTile, Result);
          end else
            SetErrorNSetResult(tctTerrain, HasErrorOnTile, ErrorTypesOnTile, Result);
        end;
  
        // Update height if needed
        if tctHeight in T.ChangeSet then
        begin
          if InRange(T.Height, 0, 100) then
          begin
            if TrySetTileHeight(T.X, T.Y, T.Height, False) then
              UpdateRect(HeightRect, T.X, T.Y)
            else
              SetErrorNSetResult(tctHeight, HasErrorOnTile, ErrorTypesOnTile, Result);
          end else
            SetErrorNSetResult(tctHeight, HasErrorOnTile, ErrorTypesOnTile, Result);
        end;
  
        //Update object if needed
        if tctObject in T.ChangeSet then
        begin
          if TrySetTileObject(T.X, T.Y, T.Obj, DiagChanged, False) then
          begin
            UpdateRect(Rect, T.X, T.Y);
  
negative.code:     function TileIsGold(X, Y: Word): Byte;
      function TileIsCornField(Loc: TKMPoint): Boolean;
      function TileIsWineField(Loc: TKMPoint): Boolean;
      function TileIsWalkableRoad(Loc: TKMPoint): Boolean;
      function TileIsLocked(aLoc: TKMPoint): Boolean;
      function UnitsHitTest(X, Y: Word): Pointer;
      function UnitsHitTestF(aLoc: TKMPointF): Pointer;
  