Skip to content
Snippets Groups Projects
Commit d8684886 authored by Damian Hofmann's avatar Damian Hofmann Committed by Jean-Patrick Guerrero
Browse files

Chess: Fix short-castling for black

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.)
parent 7a4c0e85
No related branches found
No related tags found
No related merge requests found
......@@ -1147,7 +1147,7 @@ function realchess.move(pos, from_list, from_index, to_list, to_index, _, player
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment