Closed ghost closed 3 months ago
Oh crap, I’ll fix that later today, since I’m afk. Temporary workaround is just taking the piece and checking that before calling .type… but yeah this shouldn’t be the case
Btw if you are trying to loop over all pieces this is faster
auto occ = board.occ();
while (occ.getBits())
{
auto sq = occ.pop();
auto pc = board.at(sq);
// do something with sq/pc
}
Piece::type() returns PieceType::PAWN for Piece::NONE.
The code above should print out 1 for squares A3 to H6. Inspecting the code on line 1106
Which means Piece::NONE == 12 returns PieceType::PAWN == 0 instead of PieceType::NONE == 6