anchor.diff:      NodeBuffers: PCPFNodeBuffers;
       NODEPTR_MODIFIER: NativeInt;
     {$endif}
  +
  +  // flags: oddyfinish, hexagonal, simple, moveleft, movedown (see TTileMap.AllocateHeuristedNode()
  +  function CalculateFlags(Kind, Start, Finish: NativeInt): NativeInt; far;
  +  const
  +    MOVELEFT_OFFSET = 3;
  +    MOVELEFT_MASK = Integer(1 shl MOVELEFT_OFFSET);
  +    MOVEDOWN_OFFSET = 4;
  +    MOVEDOWN_MASK = Integer(1 shl MOVEDOWN_OFFSET);
  +  var
  +    X, Y, Mask: NativeInt;
  +  begin
  +    // oddyfinish, hexagonal, simple
  +    Result := ((Kind - 1) and 4) + (((Kind + 1) and 4) shr 1) + (Finish and 1);
  +
  +    // (dX, dY) = Start.Coordinates - Finish.Coordinates;
  +    Y := Word(Start);
  +    X := (Start shr 16);
  +    Y := Y - Word(Finish);
  +    X := X - (Finish shr 16);
  +
  +    // Y := Abs(dY)
  +    Mask := -(Y shr HIGH_NATIVE_BIT);
  +    Y := Y xor Mask;
  +    Dec(Y, Mask);
  +    Result := Result or (Mask and MOVEDOWN_MASK);
  +
  +    // X := Abs(dX)
  +    Mask := -(X shr HIGH_NATIVE_BIT);
  +    X := X xor Mask;
  +    Dec(X, Mask);
  +    Result := Result or ((Mask and MOVELEFT_MASK) xor MOVELEFT_MASK);
  +
  +    // hexagonal correction
  +    if (Result and 2{hexagonal} <> 0) and (X = 0) then
  +    begin
  +      Result := Result and (not MOVELEFT_MASK);
  +      Result := Result or (((not Result) and Y and 1) shl MOVELEFT_OFFSET);
  +    end;
  +  end;
  +
   begin
     // store Self
     Store.Self := Pointer({$ifdef CPFLIB}@Self{$else}Self{$endif});
   
     // flags: oddyfinish, hexagonal, simple, moveleft, movedown
  -  X := NativeInt(Self.FKind);
  -  Store.Flags := ((X - 1) and 4) + (((X + 1) and 4) shr 1) +
  -    (PNativeInt(@Self.FInfo.FinishPoint)^ and 1) +
  -    FLAGS_MOVE_LEFT_DOWN[(StartNode.NodeInfo shr 4) and $f]{!!!} and not(1 shl 3);
  +  Store.Flags := CalculateFlags(NativeInt(FKind), Cardinal(StartNode.Coordinates), Cardinal(Self.FInfo.FinishPoint));
   
     // information copy
     Move(Self.FInfo, Store.Info,
  
positive.code:     LookupLineFmt('ERROR_WEIGHT_VALUE = ''Invalid weight value. 0,0..%0.1f - pathless, %0.1f..%0.1f - correct'';',
        [MIN_WEIGHT_VALUE_LINE, MIN_WEIGHT_VALUE_LINE, MAX_WEIGHT_VALUE_LINE]);
  
      // FLAGS_MOVE_LEFT_DOWN
      LookupLine;
      LookupLine('FLAGS_MOVE_LEFT_DOWN: array[0..15{way:3;clockwise:1}] of Byte = (');
      ByteValue := @BytesBuffer[0][0];
      for Way := 0 to 15 do
      begin
        AddFlagMoveLeftDown(ByteValue, WayChildValue(Way and 7), Way >= 8);
        Inc(ByteValue);
      end;
      LookupBytesBufferLines(1);
      LookupLine(');');
  
      // CHILD_ARRAYS
      LookupLine;
      LookupLine('CHILD_ARRAYS: array[0..31{way:3;clockwise:1;hexagonal:1}] of TChildList = (');
  
negative.code:       Result := 4;
      end;
    end;
  end;
  
  procedure AddChildArray(WayChild: Integer; ClockWise, Hexagonal, Finalize: Boolean);
  