From f21071ce4e2794632ec9f1894e5e9f1b8e17dfe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Tue, 11 Jun 2024 00:56:24 +0800 Subject: [PATCH 1/2] Guanxing fix --- lua/server/room.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/server/room.lua b/lua/server/room.lua index 8488849..bd3bc93 100644 --- a/lua/server/room.lua +++ b/lua/server/room.lua @@ -2115,9 +2115,12 @@ function Room:askForGuanxing(player, cards, top_limit, bottom_limit, customNotif local command = "AskForGuanxing" self:notifyMoveFocus(player, customNotify or command) local max_top = top_limit and top_limit[2] or #cards - local card_map = {table.slice(cards, 1, max_top + 1)} + local card_map = {} + if max_top > 0 then + table.insert(card_map, table.slice(cards, 1, max_top + 1)) + end if max_top < #cards then - table.insert(card_map, table.slice(cards, max_top)) + table.insert(card_map, table.slice(cards, max_top + 1)) end local data = { prompt = "", -- Gitee From 1027e07659075fc2295f5c6a305244fb4a8f8d17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Tue, 11 Jun 2024 01:02:33 +0800 Subject: [PATCH 2/2] fix --- lua/server/room.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/server/room.lua b/lua/server/room.lua index bd3bc93..f55c6f9 100644 --- a/lua/server/room.lua +++ b/lua/server/room.lua @@ -2118,6 +2118,8 @@ function Room:askForGuanxing(player, cards, top_limit, bottom_limit, customNotif local card_map = {} if max_top > 0 then table.insert(card_map, table.slice(cards, 1, max_top + 1)) + else + table.insert(card_map, {}) end if max_top < #cards then table.insert(card_map, table.slice(cards, max_top + 1)) -- Gitee