In the code for black short-castling, the presence of rook_black_2 was checked on the wrong field (1 instead of 8), which prevents black from short-castling. (This was probably overlooked when copying the logic from the long-castling check directly above.)
end
elseif to_x == 6 then
local castlingBlackR = meta:get_int("castlingBlackR")
- local idx8 = inv:get_stack(from_list, 1):get_name()
+ local idx8 = inv:get_stack(from_list, 8):get_name()
if castlingBlackR == 1 and idx8 == "realchess:rook_black_2" then
for i = from_index + 1, 7 do