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.)
This commit is contained in:
parent
7a4c0e852a
commit
d868488633
@ -1147,7 +1147,7 @@ function realchess.move(pos, from_list, from_index, to_list, to_index, _, player
|
|||||||
end
|
end
|
||||||
elseif to_x == 6 then
|
elseif to_x == 6 then
|
||||||
local castlingBlackR = meta:get_int("castlingBlackR")
|
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
|
if castlingBlackR == 1 and idx8 == "realchess:rook_black_2" then
|
||||||
for i = from_index + 1, 7 do
|
for i = from_index + 1, 7 do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user