1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 01:03:09 +00:00

More readable score<CAPTURES>()

No functional change.
This commit is contained in:
Marco Costalba 2015-01-31 20:13:38 +01:00
parent f3189bdc9a
commit 519b2fe849

View file

@ -148,11 +148,15 @@ void MovePicker::score<CAPTURES>() {
// has been picked up in pick_move_from_list(). This way we save some SEE // has been picked up in pick_move_from_list(). This way we save some SEE
// calls in case we get a cutoff. // calls in case we get a cutoff.
for (auto& m : *this) for (auto& m : *this)
if (type_of(m) == ENPASSANT)
m.value = PieceValue[MG][PAWN] - Value(PAWN);
else if (type_of(m) == PROMOTION)
m.value = PieceValue[MG][pos.piece_on(to_sq(m))] - Value(PAWN)
+ PieceValue[MG][promotion_type(m)] - PieceValue[MG][PAWN];
else
m.value = PieceValue[MG][pos.piece_on(to_sq(m))] m.value = PieceValue[MG][pos.piece_on(to_sq(m))]
- Value(type_of(pos.moved_piece(m))) - Value(type_of(pos.moved_piece(m)));
+ (type_of(m) == ENPASSANT ? PieceValue[MG][PAWN] :
type_of(m) == PROMOTION ? PieceValue[MG][promotion_type(m)] - PieceValue[MG][PAWN]
: VALUE_ZERO);
} }
template<> template<>