In the code for black short-castling, the presence of rook_black_2 is checked on the wrong field (1 instead of 8, where rook_black_1 is placed initially), which prevents black from short-castling. (This was probably overlooked when copying the logic from the long-castling check directly above.)
After making this change, so that idx8 indeed refers to the figure on field 8, castling indeed works as expected.
Edit: And while we're at it, as issue #120 points out, the king should move two squares towards the rook when queen-side castling. This is now fixed in the second commit.
In the code for black short-castling, the presence of rook_black_2 is checked on the wrong field (1 instead of 8, where rook_black_1 is placed initially), which prevents black from short-castling. (This was probably overlooked when copying the logic from the long-castling check directly above.)
After making this change, so that
idx8
indeed refers to the figure on field 8, castling indeed works as expected.Edit: And while we're at it, as issue #120 points out, the king should move two squares towards the rook when queen-side castling. This is now fixed in the second commit.