Commit b3ca5d1f6c2ae3e689ae12024c222a295dd67e15
Merge branch 'tr/bugfix' into tr/bugfix-qa
Showing
1 changed file
with
18 additions
and
16 deletions
Show diff stats
src/models/Activity.lua
... | ... | @@ -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 | ... | ... |