1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

Simplify backward pawn definition

Make use of 'lever' attribute

No functional change

Resolves #234
This commit is contained in:
Alain SAVARD 2015-01-26 11:05:53 -05:00 committed by Joona Kiiski
parent 7837fb2aca
commit 8aa8608c2a

View file

@ -144,12 +144,11 @@ namespace {
lever = theirPawns & pawnAttacksBB[s];
// Test for backward pawn.
// If the pawn is passed, isolated, or connected it cannot be
// If the pawn is passed, isolated, connected or a lever it cannot be
// backward. If there are friendly pawns behind on adjacent files
// or if it can capture an enemy pawn it cannot be backward either.
if ( (passed | isolated | connected)
|| (ourPawns & pawn_attack_span(Them, s))
|| (pos.attacks_from<PAWN>(s, Us) & theirPawns))
// it cannot be backward either.
if ( (passed | isolated | connected | lever)
|| (ourPawns & pawn_attack_span(Them, s)))
backward = false;
else
{