Commit 1d7517e6a3fd91cb31d0925675afd69904300c57

Authored by chenyueqi
1 parent 6897e0e3

新春签到代码优化,支持不同时开同类型的签到活动,方便后期复用

Showing 1 changed file with 5 additions and 3 deletions   Show diff stats
src/models/Activity.lua
... ... @@ -1097,9 +1097,11 @@ activityFunc[Activity.ActivityType.NewSign] = {
1097 1097 -- end,
1098 1098 ["crossDay"] = function(self, actType, notify)
1099 1099 local curData = self:getActData(actType)
1100   - curData["0"] = (curData["0"] or 0) + 1
1101   - local actData = csvdb["activity_signInCsv"][48] or {}
1102   - if curData["0"] > #actData then return end -- 满了就忽略了
  1100 + local isOpen, actId = self:isOpen(actType)
  1101 + local actData = csvdb["activity_signInCsv"][actId] or {}
  1102 + curData["0"] = curData["0"] or 0
  1103 + if curData["0"] >= #actData then return end -- 满了就忽略了
  1104 + curData["0"] = curData["0"] + 1
1103 1105  
1104 1106 -- 没满更新一下
1105 1107 self:updateActData(actType, curData, not notify)
... ...