anchor.diff:        Land[Y,X].BaseLayer.Rotation := RotID[Bits];
       end;
       UpdatePassability(KMPoint(X,Y));
  +    AddToVisited(X,Y);
  +
  +    //Floodfill through around tiles
  +    UpdateTransition(X,  Y-1, aTransitionType, aStep + 1); //  x x x
  +    UpdateTransition(X+1,Y,   aTransitionType, aStep + 1); //  x   x
  +    UpdateTransition(X,  Y+1, aTransitionType, aStep + 1); //  x x x
  +    UpdateTransition(X-1,Y,   aTransitionType, aStep + 1);
  +    UpdateTransition(X-1,Y-1, aTransitionType, aStep + 1);
  +    UpdateTransition(X+1,Y-1, aTransitionType, aStep + 1);
  +    UpdateTransition(X+1,Y+1, aTransitionType, aStep + 1);
  +    UpdateTransition(X-1,Y+1, aTransitionType, aStep + 1);
     end;
   
   var
  
positive.code:     end;
    end;
  
    procedure UpdateTransition(X,Y: Integer; aTransitionType: TStoneTransitionType);
  
      function GetBits(aX,aY: Integer): Byte;
      begin
  
negative.code:   TileIDDiagIndex: array[1..15] of Word = (5,5,6,5,5,6,5,5,6,5,5,6,5,5,5);
    RotIdDiag:       array[1..15] of Byte = (3,0,0,1,3,1,3,2,3,0,0,2,0,0,0);
  
    MAX_STEPS = 255; //No steps limit for now
  
  var
    Visited: TKMPointArray;
    fVisitedCnt: Integer;
  
    procedure InitVisited;
    begin
      SetLength(Visited, 8);
      fVisitedCnt := 0;
    end;
  
    procedure AddToVisited(X,Y: Word);
    begin
      if Length(Visited) = fVisitedCnt then
        SetLength(Visited, fVisitedCnt + 8);
  
      Visited[fVisitedCnt] := KMPoint(X,Y);
      Inc(fVisitedCnt);
    end;
  
    function GetTile(aTransitionType: TStoneTransitionType; aTileIdIndex: Byte): Word;
    begin
      if aTileIdIndex = 0 then
  