X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.cpp;h=069c8d9401aa29127699235ee9e6cb872384d367;hp=73a9b904b347757fda1ba601344dfd69f913259b;hb=55bd27b8f08a151128d7065fa2819aa3e9605299;hpb=4f5680950a4e4c55da2877e1be91efd2be1c76ba diff --git a/src/pawns.cpp b/src/pawns.cpp index 73a9b904..069c8d94 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -240,12 +240,12 @@ Value PawnEntry::shelter_storm(const Position& pos, Square ksq) { { // Shelter penalty is higher for the pawn in front of the king b = ourPawns & FileBB[f]; - rkUs = b ? rank_of(Us == WHITE ? first_1(b) : ~last_1(b)) : RANK_1; + rkUs = b ? rank_of(Us == WHITE ? lsb(b) : ~msb(b)) : RANK_1; safety -= ShelterWeakness[f != kf][rkUs]; // Storm danger is smaller if enemy pawn is blocked b = theirPawns & FileBB[f]; - rkThem = b ? rank_of(Us == WHITE ? first_1(b) : ~last_1(b)) : RANK_1; + rkThem = b ? rank_of(Us == WHITE ? lsb(b) : ~msb(b)) : RANK_1; safety -= StormDanger[rkThem == rkUs + 1][rkThem]; }