From eeff20958b89328c06041ebbbb98aa45a1d9858a Mon Sep 17 00:00:00 2001 From: xxyheaven <1433191064@qq.com> Date: Mon, 20 May 2024 22:20:50 +0800 Subject: [PATCH] =?UTF-8?q?fix=20guanxing=EF=BC=9Baskforchoice=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E9=80=89cancel=EF=BC=9B=E6=B8=85=E7=A9=BAinteraction.?= =?UTF-8?q?data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/client/client_util.lua | 1 + lua/server/room.lua | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/client/client_util.lua b/lua/client/client_util.lua index a0c8dce..5447933 100644 --- a/lua/client/client_util.lua +++ b/lua/client/client_util.lua @@ -621,6 +621,7 @@ end function GetInteractionOfSkill(skill_name) local skill = Fk.skills[skill_name] if skill and skill.interaction then + skill.interaction.data = nil return skill:interaction() end return nil diff --git a/lua/server/room.lua b/lua/server/room.lua index 30cc946..41fc170 100644 --- a/lua/server/room.lua +++ b/lua/server/room.lua @@ -1858,7 +1858,13 @@ function Room:askForChoice(player, choices, skill_name, prompt, detailed, all_ch local result = self:doRequest(player, command, json.encode{ choices, all_choices, skill_name, prompt, detailed }) - if result == "" then result = choices[1] end + if result == "" then + if table.contains(choices, "Cancel") then + result = "Cancel" + else + result = choices[1] + end + end return result end @@ -2050,7 +2056,7 @@ function Room:askForGuanxing(player, cards, top_limit, bottom_limit, customNotif for i = #top, 1, -1 do table.insert(self.draw_pile, 1, top[i]) end - for i = 1, #bottom, -1 do + for i = 1, #bottom, 1 do table.insert(self.draw_pile, bottom[i]) end -- Gitee