mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 01:03:09 +00:00
Simplify the shelter mask
The line 246 of pawns.cpp is not necessary, because we restrict the bitboards to file_of(f) in lines 253 and 256 anyway. No functional change.
This commit is contained in:
parent
66af80972a
commit
73e8daa150
1 changed files with 2 additions and 4 deletions
|
@ -240,14 +240,12 @@ Value Entry::shelter_storm(const Position& pos, Square ksq) {
|
||||||
|
|
||||||
enum { BlockedByKing, Unopposed, BlockedByPawn, Unblocked };
|
enum { BlockedByKing, Unopposed, BlockedByPawn, Unblocked };
|
||||||
|
|
||||||
File center = std::max(FILE_B, std::min(FILE_G, file_of(ksq)));
|
Bitboard b = pos.pieces(PAWN) & (forward_ranks_bb(Us, ksq) | rank_bb(ksq));
|
||||||
Bitboard b = pos.pieces(PAWN)
|
|
||||||
& (forward_ranks_bb(Us, ksq) | rank_bb(ksq))
|
|
||||||
& (adjacent_files_bb(center) | file_bb(center));
|
|
||||||
Bitboard ourPawns = b & pos.pieces(Us);
|
Bitboard ourPawns = b & pos.pieces(Us);
|
||||||
Bitboard theirPawns = b & pos.pieces(Them);
|
Bitboard theirPawns = b & pos.pieces(Them);
|
||||||
Value safety = MaxSafetyBonus;
|
Value safety = MaxSafetyBonus;
|
||||||
|
|
||||||
|
File center = std::max(FILE_B, std::min(FILE_G, file_of(ksq)));
|
||||||
for (File f = File(center - 1); f <= File(center + 1); ++f)
|
for (File f = File(center - 1); f <= File(center + 1); ++f)
|
||||||
{
|
{
|
||||||
b = ourPawns & file_bb(f);
|
b = ourPawns & file_bb(f);
|
||||||
|
|
Loading…
Add table
Reference in a new issue