Commit c5fe43c2b0b215e641f80517398530177872dd92
1 parent
d1944a2b
fix: 活动派遣不占用正常讨伐电台派遣队伍数量
Showing
1 changed file
with
22 additions
and
6 deletions
Show diff stats
src/actions/RadioAction.lua
| @@ -113,14 +113,29 @@ function _M.startQuestRpc(agent, data) | @@ -113,14 +113,29 @@ function _M.startQuestRpc(agent, data) | ||
| 113 | local msg = MsgPack.unpack(data) | 113 | local msg = MsgPack.unpack(data) |
| 114 | local id = msg.id | 114 | local id = msg.id |
| 115 | local heros = msg.heros | 115 | local heros = msg.heros |
| 116 | - local result = {} | ||
| 117 | - local radioTask = role:getProperty("radioTask") | ||
| 118 | - if table.numbers(radioTask) >= getQuestMax(role) then | ||
| 119 | - return 1 | ||
| 120 | - end | 116 | + |
| 121 | -- check id | 117 | -- check id |
| 122 | local config = csvdb["crusadeCsv"][id] | 118 | local config = csvdb["crusadeCsv"][id] |
| 123 | - if not config then return 2 end | 119 | + if not config then return 1 end |
| 120 | + | ||
| 121 | + local radioTask = role:getProperty("radioTask") | ||
| 122 | + | ||
| 123 | + local getTaskNum = function () | ||
| 124 | + local num = 0 | ||
| 125 | + for _, v in pairs(radioTask or {}) do | ||
| 126 | + if (v.actid or 0) == 0 then | ||
| 127 | + num = num + 1 | ||
| 128 | + end | ||
| 129 | + end | ||
| 130 | + return num | ||
| 131 | + end | ||
| 132 | + | ||
| 133 | + if config.activity_ctrl_id == 0 then | ||
| 134 | + if getTaskNum() >= getQuestMax(role) then | ||
| 135 | + return 2 | ||
| 136 | + end | ||
| 137 | + end | ||
| 138 | + | ||
| 124 | if not role:checkHangPass(config.unlock) then return 3 end | 139 | if not role:checkHangPass(config.unlock) then return 3 end |
| 125 | if radioTask[id] then return 4 end | 140 | if radioTask[id] then return 4 end |
| 126 | -- check hero | 141 | -- check hero |
| @@ -172,6 +187,7 @@ function _M.startQuestRpc(agent, data) | @@ -172,6 +187,7 @@ function _M.startQuestRpc(agent, data) | ||
| 172 | local taskData = {} | 187 | local taskData = {} |
| 173 | taskData["time"] = skynet.timex() + config.time + timeSub | 188 | taskData["time"] = skynet.timex() + config.time + timeSub |
| 174 | taskData["heros"] = heros | 189 | taskData["heros"] = heros |
| 190 | + taskData["actid"] = config.activity_ctrl_id | ||
| 175 | radioTask[id] = taskData | 191 | radioTask[id] = taskData |
| 176 | role:updateProperty({field="radioTask", value=radioTask, notNotify=true}) | 192 | role:updateProperty({field="radioTask", value=radioTask, notNotify=true}) |
| 177 | 193 |