Chess: Fix player unable to resign sometimes

This commit is contained in:
Wuzzy 2023-07-21 09:15:16 +02:00
parent 5b6970e94a
commit 24ef28e0a5

View File

@ -2883,7 +2883,8 @@ function realchess.fields(pos, _, fields, sender)
if fields.resign and mode ~= "bot_vs_bot" then
local lastMove = meta:get_string("lastMove")
if playerWhite == "" and playerBlack == "" or lastMove == "" then
if (playerName == playerWhite and playerWhite == "") or (playerName == playerBlack and playerBlack == "") then
-- Can't resign before the player name has been recorded
send_message(playerName, S("Resigning is not possible yet."))
return
end