Commit b3ca5d1f6c2ae3e689ae12024c222a295dd67e15

Authored by 熊润斐
2 parents 4122c3bd bb30b1c1

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,25 +834,27 @@ activityFunc[Activity.ActivityType.Crisis] = {
834 for id, actSet in pairs(actCsv) do 834 for id, actSet in pairs(actCsv) do
835 if actSet.type == atype then 835 if actSet.type == atype then
836 local status = actData.task[id] or 0 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 end 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 end 857 end
854 - actData.task[id] = status  
855 - change = true  
856 end 858 end
857 end 859 end
858 if change then 860 if change then