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.)
master
Damian Hofmann 2020-06-07 02:32:13 +02:00 committed by Jean-Patrick Guerrero
parent 7a4c0e852a
commit d868488633
1 changed files with 1 additions and 1 deletions

View File

@ -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