fix: check for a card in the stack before checking rank

main
LeRoyce Pearson 2024-02-15 23:02:46 -07:00
parent ce5a238870
commit 346070c51d
1 changed files with 1 additions and 1 deletions

View File

@ -335,7 +335,7 @@ function update()
local has_won=true local has_won=true
for i=3,6 do for i=3,6 do
local stack=stacks[i] local stack=stacks[i]
has_won=(has_won and stack[#stack].rank>=13) has_won=(has_won and #stack>0 and stack[#stack].rank>=13)
end end
if has_won then if has_won then
pmem(WIN_COUNT_SLOT, pmem(WIN_COUNT_SLOT) + 1) pmem(WIN_COUNT_SLOT, pmem(WIN_COUNT_SLOT) + 1)