From a7fa1d9ec09f990f30b5a04ab354532377e0c2bf Mon Sep 17 00:00:00 2001 From: YoumuKon <38815081+YoumuKon@users.noreply.github.com> Date: Sat, 17 Jun 2023 10:45:53 +0800 Subject: [PATCH] bug fix? (#199) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 测试服的第一个bug fix - 修复了Fk.currentResponsePattern的无懈可击寿命过长的的bug --- Fk/LobbyElement/RoomGeneralSettings.qml | 2 +- lua/server/room.lua | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Fk/LobbyElement/RoomGeneralSettings.qml b/Fk/LobbyElement/RoomGeneralSettings.qml index fa400c7b..7a52d713 100644 --- a/Fk/LobbyElement/RoomGeneralSettings.qml +++ b/Fk/LobbyElement/RoomGeneralSettings.qml @@ -88,8 +88,8 @@ Flickable { id: warning anchors.rightMargin: 8 visible: { - const avail = JSON.parse(Backend.callLuaFunction("GetAvailableGeneralsNum", [])); config.disabledPack; // 没什么用,只是为了禁包刷新时刷新visible罢了 + const avail = JSON.parse(Backend.callLuaFunction("GetAvailableGeneralsNum", [])); const ret = avail < config.preferredGeneralNum * config.preferedPlayerNum; return ret; } diff --git a/lua/server/room.lua b/lua/server/room.lua index c0b43bfc..fc1ae13b 100644 --- a/lua/server/room.lua +++ b/lua/server/room.lua @@ -1586,11 +1586,11 @@ function Room:askForUseCard(player, card_name, pattern, prompt, cancelable, extr Fk.currentResponsePattern = pattern local result = self:doRequest(player, command, json.encode(data)) + Fk.currentResponsePattern = nil if result ~= "" then return self:handleUseCardReply(player, result) end - Fk.currentResponsePattern = nil end return nil end @@ -1631,6 +1631,7 @@ function Room:askForResponse(player, card_name, pattern, prompt, cancelable, ext Fk.currentResponsePattern = pattern local result = self:doRequest(player, command, json.encode(data)) + Fk.currentResponsePattern = nil if result ~= "" then local use = self:handleUseCardReply(player, result) @@ -1638,7 +1639,6 @@ function Room:askForResponse(player, card_name, pattern, prompt, cancelable, ext return use.card end end - Fk.currentResponsePattern = nil end return nil end @@ -2291,6 +2291,7 @@ function Room:handleCardEffect(event, cardEffectEvent) self:useCard(use) end end + Fk.currentResponsePattern = nil elseif event == fk.CardEffecting then if cardEffectEvent.card.skill then execGameEvent(GameEvent.SkillEffect, function ()