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:
parent
f3189bdc9a
commit
519b2fe849
1 changed files with 9 additions and 5 deletions
|
@ -148,11 +148,15 @@ void MovePicker::score<CAPTURES>() {
|
|||
// has been picked up in pick_move_from_list(). This way we save some SEE
|
||||
// calls in case we get a cutoff.
|
||||
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))]
|
||||
- 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);
|
||||
- Value(type_of(pos.moved_piece(m)));
|
||||
}
|
||||
|
||||
template<>
|
||||
|
|
Loading…
Add table
Reference in a new issue