mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 10:57:43 +00:00
Retire the misdesigned StepAttacks[] array.
StepAttacks[] is misdesigned, the color dependance is specific to pawns, and trying to generalise to king and knights, proves neither useful nor convinient in practice. So this patch reformats the code with the following changes: - Use PieceType instead of Piece in attacks_() functions - Use PseudoAttacks for KING and KNIGHT - Rename StepAttacks[] into PawnAttacks[] Original patch and idea from Alain Savard. No functional change. Closes #1086
This commit is contained in:
committed by
Joona Kiiski
parent
b1b19343cd
commit
e06a117d5e
@@ -1292,7 +1292,7 @@ void Tablebases::init(const std::string& paths) {
|
||||
if (MapA1D1D4[s1] == idx && (idx || s1 == SQ_B1)) // SQ_B1 is mapped to 0
|
||||
{
|
||||
for (Square s2 = SQ_A1; s2 <= SQ_H8; ++s2)
|
||||
if ((StepAttacksBB[KING][s1] | s1) & s2)
|
||||
if ((PseudoAttacks[KING][s1] | s1) & s2)
|
||||
continue; // Illegal position
|
||||
|
||||
else if (!off_A1H8(s1) && off_A1H8(s2) > 0)
|
||||
|
||||
Reference in New Issue
Block a user