Commit 041ee0b2b3df6727fef3a6c9490b918cc7c5ca4f

Authored by zhangqijia
1 parent 2c3a1b31

fix: 挂机图鉴的bug

1. 若两个宝藏出现在同一个探索点,显示的时间异常
2. 线上,每日宝藏刷新的地点应该刷新在非我挂机的地点,而且每个宝藏需要不同地点
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 128 --挂机得到的宝藏加入到挂机奖励
129 129 if isTreasure or false == true then
130 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 133 local award = val.award:toNumMap()
134 134 for k,v in pairs(award) do
135 135 items[k] = (items[k] or 0) + v
... ...
src/models/Daily.lua
... ... @@ -170,26 +170,25 @@ function Daily:checkChapters()
170 170 local chapters = {}
171 171 local tmp_chapters = {}
172 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 177 end
180 178 end
181 179 end
182   -
  180 + local hangInfo = self.owner:getProperty("hangInfo") or {}
183 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 187 chapters[chapter_id] = val
190 188 end
191 189 end
192 190 end
  191 +
193 192 end
194 193 return chapters
195 194 end
... ...