It is redundant. Use pieceList[c][KING][0] instead.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
struct ReducedStateInfo {
Key key, pawnKey, materialKey;
int castleRights, rule50;
struct ReducedStateInfo {
Key key, pawnKey, materialKey;
int castleRights, rule50;
- Square kingSquare[2], epSquare;
Value mgValue, egValue;
Value npMaterial[2];
};
Value mgValue, egValue;
Value npMaterial[2];
};
board[to] = board[from];
board[from] = EMPTY;
board[to] = board[from];
board[from] = EMPTY;
- // If the moving piece was a king, update the king square
- if (pt == KING)
- st->kingSquare[us] = to;
-
// Update piece lists, note that index[from] is not updated and
// becomes stale. This works as long as index[] is accessed just
// by known occupied squares.
// Update piece lists, note that index[from] is not updated and
// becomes stale. This works as long as index[] is accessed just
// by known occupied squares.
board[kto] = king;
board[rto] = rook;
board[kto] = king;
board[rto] = rook;
- // Update king square
- st->kingSquare[us] = kto;
-
// Update piece lists
pieceList[us][KING][index[kfrom]] = kto;
pieceList[us][ROOK][index[rfrom]] = rto;
// Update piece lists
pieceList[us][KING][index[kfrom]] = kto;
pieceList[us][ROOK][index[rfrom]] = rto;
set_bit(&byTypeBB[0], s); // HACK: byTypeBB[0] contains all occupied squares.
pieceCount[c][pt]++;
set_bit(&byTypeBB[0], s); // HACK: byTypeBB[0] contains all occupied squares.
pieceCount[c][pt]++;
-
- if (pt == KING)
- st->kingSquare[c] = s;
struct StateInfo {
Key key, pawnKey, materialKey;
int castleRights, rule50;
struct StateInfo {
Key key, pawnKey, materialKey;
int castleRights, rule50;
- Square kingSquare[2], epSquare;
Value mgValue, egValue;
Value npMaterial[2];
Value mgValue, egValue;
Value npMaterial[2];
}
inline Square Position::king_square(Color c) const {
}
inline Square Position::king_square(Color c) const {
- return st->kingSquare[c];
+ return pieceList[c][KING][0];
}
inline bool Position::can_castle_kingside(Color side) const {
}
inline bool Position::can_castle_kingside(Color side) const {