From 21c09fa267684a5e1b46046b9e2f4be4584a89e0 Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Wed, 27 Oct 2021 11:21:26 +0800 Subject: [PATCH] fix: 活动派遣 同时只能有一个存在 --- src/actions/RadioAction.lua | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/actions/RadioAction.lua b/src/actions/RadioAction.lua index 93c8b2b..ee13bad 100644 --- a/src/actions/RadioAction.lua +++ b/src/actions/RadioAction.lua @@ -120,20 +120,26 @@ function _M.startQuestRpc(agent, data) local radioTask = role:getProperty("radioTask") - local getTaskNum = function () - local num = 0 + local getActIDs = function () + local actids = {} for _, v in pairs(radioTask or {}) do - if (v.actid or 0) == 0 then - num = num + 1 - end + actids[v.actid] = (actids[v.actid] or 0) + 1 end - return num + return actids end + local actids = getActIDs() if config.activity_ctrl_id == 0 then - if getTaskNum() >= getQuestMax(role) then + --非活动 判断数量 + if (actids[config.activity_ctrl_id] or 0) >= getQuestMax(role) then return 2 end + + else + --活动 同时只能有一个存在 + if actids[config.activity_ctrl_id] >= 1 then + return 5 + end end if not role:checkHangPass(config.unlock) then return 3 end -- libgit2 0.21.2