No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
bool ambiguousMove, ambiguousFile, ambiguousRank;
Square sq, from = from_sq(m);
Square to = to_sq(m);
bool ambiguousMove, ambiguousFile, ambiguousRank;
Square sq, from = from_sq(m);
Square to = to_sq(m);
- PieceType pt = type_of(pos.piece_on(from));
+ PieceType pt = type_of(pos.piece_moved(m));
string san;
if (is_castle(m))
string san;
if (is_castle(m))
void MovePicker::score_noncaptures() {
Move m;
void MovePicker::score_noncaptures() {
Move m;
for (MoveStack* cur = moves; cur != lastMove; cur++)
{
m = cur->move;
for (MoveStack* cur = moves; cur != lastMove; cur++)
{
m = cur->move;
- from = from_sq(m);
- cur->score = H.value(pos.piece_on(from), to_sq(m));
+ cur->score = H.value(pos.piece_moved(m), to_sq(m));
Bitboard occ, xray;
Square from = from_sq(m);
Square to = to_sq(m);
Bitboard occ, xray;
Square from = from_sq(m);
Square to = to_sq(m);
- Piece piece = piece_on(from);
+ Piece piece = piece_moved(m);
assert(!square_is_empty(from));
assert(!square_is_empty(from));
Color us = sideToMove;
Square from = from_sq(m);
Color us = sideToMove;
Square from = from_sq(m);
- assert(color_of(piece_on(from)) == us);
+ assert(color_of(piece_moved(m)) == us);
assert(piece_on(king_square(us)) == make_piece(us, KING));
// En passant captures are a tricky special case. Because they are rather
assert(piece_on(king_square(us)) == make_piece(us, KING));
// En passant captures are a tricky special case. Because they are rather
Bitboard b = occupied_squares();
assert(to == ep_square());
Bitboard b = occupied_squares();
assert(to == ep_square());
- assert(piece_on(from) == make_piece(us, PAWN));
+ assert(piece_moved(m) == make_piece(us, PAWN));
assert(piece_on(capsq) == make_piece(them, PAWN));
assert(piece_on(to) == NO_PIECE);
assert(piece_on(capsq) == make_piece(them, PAWN));
assert(piece_on(to) == NO_PIECE);
Color them = ~sideToMove;
Square from = from_sq(m);
Square to = to_sq(m);
Color them = ~sideToMove;
Square from = from_sq(m);
Square to = to_sq(m);
- Piece pc = piece_on(from);
+ Piece pc = piece_moved(m);
// Use a slower but simpler function for uncommon cases
if (is_special(m))
// Use a slower but simpler function for uncommon cases
if (is_special(m))
{
// In case of king moves under check we have to remove king so to catch
// as invalid moves like b1a1 when opposite queen is on c1.
{
// In case of king moves under check we have to remove king so to catch
// as invalid moves like b1a1 when opposite queen is on c1.
- if (type_of(piece_on(from)) == KING)
+ if (type_of(pc) == KING)
{
Bitboard b = occupied_squares();
b ^= from;
{
Bitboard b = occupied_squares();
b ^= from;
- if (attackers_to(to_sq(m), b) & pieces(~us))
+ if (attackers_to(to, b) & pieces(~us))
// Our move must be a blocking evasion or a capture of the checking piece
target = squares_between(checksq, king_square(us)) | checkers();
// Our move must be a blocking evasion or a capture of the checking piece
target = squares_between(checksq, king_square(us)) | checkers();
- if (!(target & to_sq(m)))
- Square from = from_sq(m);
- Square to = to_sq(m);
-
// Early return if SEE cannot be negative because captured piece value
// is not less then capturing one. Note that king moves always return
// here because king midgame value is set to 0.
// Early return if SEE cannot be negative because captured piece value
// is not less then capturing one. Note that king moves always return
// here because king midgame value is set to 0.
- if (PieceValueMidgame[piece_on(to)] >= PieceValueMidgame[piece_on(from)])
+ if (PieceValueMidgame[piece_on(to_sq(m))] >= PieceValueMidgame[piece_moved(m)])
bool both_color_bishops(Color c) const;
bool has_pawn_on_7th(Color c) const;
bool is_chess960() const;
bool both_color_bishops(Color c) const;
bool has_pawn_on_7th(Color c) const;
bool is_chess960() const;
-
- // Current thread ID searching on the position
int64_t nodes_searched() const;
void set_nodes_searched(int64_t n);
int64_t nodes_searched() const;
void set_nodes_searched(int64_t n);
them = ~pos.side_to_move();
ksq = pos.king_square(them);
kingAtt = pos.attacks_from<KING>(ksq);
them = ~pos.side_to_move();
ksq = pos.king_square(them);
kingAtt = pos.attacks_from<KING>(ksq);
- pc = pos.piece_on(from);
+ pc = pos.piece_moved(move);
occ = pos.occupied_squares() & ~(1ULL << from) & ~(1ULL << ksq);
oldAtt = pos.attacks_from(pc, from, occ);
occ = pos.occupied_squares() & ~(1ULL << from) & ~(1ULL << ksq);
oldAtt = pos.attacks_from(pc, from, occ);