Commit a09c82408506f5583b88f14084f8593bb8a486b1
Merge branch 'tr/bugfix' into tr/publish/preview
* tr/bugfix: 活动结束回收邮件 宝藏怪
Showing
1 changed file
with
19 additions
and
17 deletions
Show diff stats
src/models/Activity.lua
... | ... | @@ -598,8 +598,8 @@ function Activity:closeActivity(actId, notify, notUpdateAct) |
598 | 598 | local actType = actData.showType |
599 | 599 | if activityFunc[actType] and activityFunc[actType]['close'] then |
600 | 600 | activityFunc[actType]["close"](self, actType, notify, actId) |
601 | - self:recycleActItem(actId) | |
602 | 601 | end |
602 | + self:recycleActItem(actId) | |
603 | 603 | if Activity.schema["act".. actType] then |
604 | 604 | if not Activity.schema["act" .. actType][3] then |
605 | 605 | self:updateActData(actType, Activity.schema["act" .. actType][2], not notify or notUpdateAct) |
... | ... | @@ -834,25 +834,27 @@ activityFunc[Activity.ActivityType.Crisis] = { |
834 | 834 | for id, actSet in pairs(actCsv) do |
835 | 835 | if actSet.type == atype then |
836 | 836 | local status = actData.task[id] or 0 |
837 | - status = status + count | |
838 | - if status >= actSet.condition1 then | |
839 | - local reward | |
840 | - if actSet.loop == 1 then | |
841 | - local rcount = math.floor(status / actSet.condition1) | |
842 | - reward = actSet.reward:toNumMap() | |
843 | - for itemId, itemC in pairs(reward) do | |
844 | - reward[itemId] = itemC * rcount | |
837 | + if status ~= -1 then | |
838 | + status = status + count | |
839 | + if status >= actSet.condition1 then | |
840 | + local reward | |
841 | + if actSet.loop == 1 then | |
842 | + local rcount = math.floor(status / actSet.condition1) | |
843 | + reward = actSet.reward:toNumMap() | |
844 | + for itemId, itemC in pairs(reward) do | |
845 | + reward[itemId] = itemC * rcount | |
846 | + end | |
847 | + status = status % actSet.condition1 | |
848 | + else | |
849 | + reward = actSet.reward | |
850 | + status = -1 | |
845 | 851 | end |
846 | - status = status % actSet.condition1 | |
847 | - else | |
848 | - reward = actSet.reward | |
849 | - status = -1 | |
850 | - end | |
851 | 852 | |
852 | - self.owner:award(reward, {log = {desc = "activity_crisis"}, notNotify = not notify}) | |
853 | + self.owner:award(reward, {log = {desc = "activity_crisis"}, notNotify = not notify}) | |
854 | + end | |
855 | + actData.task[id] = status | |
856 | + change = true | |
853 | 857 | end |
854 | - actData.task[id] = status | |
855 | - change = true | |
856 | 858 | end |
857 | 859 | end |
858 | 860 | if change then | ... | ... |