]> git.lizzy.rs Git - xdecor.git/blobdiff - src/chess.lua
Chess: Fix short-castling for black
[xdecor.git] / src / chess.lua
index a1364da8497906f4fbdc3cea10b223fcccf66ed9..be7fc96ad9d4e8f25c0152185972d02c3c954ecc 100644 (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