Commit becc58275de4abcdfff53ccf7b86ef76e9983507
Merge branch 'cn/develop' into cn/player
Showing
2 changed files
with
13 additions
and
14 deletions
Show diff stats
src/actions/HangAction.lua
@@ -128,8 +128,8 @@ local function checkReward(role, isTreasure, carbonId) | @@ -128,8 +128,8 @@ local function checkReward(role, isTreasure, carbonId) | ||
128 | --挂机得到的宝藏加入到挂机奖励 | 128 | --挂机得到的宝藏加入到挂机奖励 |
129 | if isTreasure or false == true then | 129 | if isTreasure or false == true then |
130 | local treasureList= role.dailyData:checkTreasureList(carbonId or hangInfo.carbonId) or {} | 130 | local treasureList= role.dailyData:checkTreasureList(carbonId or hangInfo.carbonId) or {} |
131 | - if next(treasureList) ~= nil then | ||
132 | - for id, val in pairs(treasureList) do | 131 | + if next(treasureList) then |
132 | + for _, val in pairs(treasureList) do | ||
133 | local award = val.award:toNumMap() | 133 | local award = val.award:toNumMap() |
134 | for k,v in pairs(award) do | 134 | for k,v in pairs(award) do |
135 | items[k] = (items[k] or 0) + v | 135 | items[k] = (items[k] or 0) + v |
src/models/Daily.lua
@@ -170,26 +170,25 @@ function Daily:checkChapters() | @@ -170,26 +170,25 @@ function Daily:checkChapters() | ||
170 | local chapters = {} | 170 | local chapters = {} |
171 | local tmp_chapters = {} | 171 | local tmp_chapters = {} |
172 | local treasureList = self:getProperty("treasureList") | 172 | local treasureList = self:getProperty("treasureList") |
173 | - if next(treasureList) ~= nil then | ||
174 | - for id, curInfo in pairs(treasureList) do | ||
175 | - if curInfo["end_time"] then | ||
176 | - if skynet.timex() < curInfo["end_time"] then | ||
177 | - tmp_chapters[curInfo.chapter_id] = curInfo | ||
178 | - end | 173 | + if next(treasureList) then |
174 | + for _, curInfo in pairs(treasureList) do | ||
175 | + if curInfo["expire_time"] or not curInfo["end_time"] then | ||
176 | + tmp_chapters[curInfo.chapter_id] = curInfo | ||
179 | end | 177 | end |
180 | end | 178 | end |
181 | end | 179 | end |
182 | - | 180 | + local hangInfo = self.owner:getProperty("hangInfo") or {} |
183 | for chapter_id, val in pairs(csvdb["idle_battleCsv"]) do | 181 | for chapter_id, val in pairs(csvdb["idle_battleCsv"]) do |
184 | - if self.owner:checkHangPass(chapter_id) then | ||
185 | - if next(tmp_chapters) == nil then | ||
186 | - chapters[chapter_id] = val | ||
187 | - else | ||
188 | - if not tmp_chapters[chapter_id] then | 182 | + if chapter_id ~= hangInfo.carbonId then |
183 | + if self.owner:checkHangPass(chapter_id) then | ||
184 | + if next(tmp_chapters) and not tmp_chapters[chapter_id] then | ||
185 | + chapters[chapter_id] = val | ||
186 | + else | ||
189 | chapters[chapter_id] = val | 187 | chapters[chapter_id] = val |
190 | end | 188 | end |
191 | end | 189 | end |
192 | end | 190 | end |
191 | + | ||
193 | end | 192 | end |
194 | return chapters | 193 | return chapters |
195 | end | 194 | end |