Commit b62c0a4c60318d10a6f343b56db4edf1a361963f

Authored by zhangqijia
1 parent 60ef966e

fix: 挂机图鉴,宝藏值使用不完全的问题

Showing 1 changed file with 3 additions and 5 deletions   Show diff stats
src/models/DailyPlugin.lua
... ... @@ -141,10 +141,8 @@ function DailyPlugin.bind(Daily)
141 141 local treasure
142 142 while next(tmpTreasure or {}) do
143 143 local tmp = {}
144   - local tmpBase = treasureBase
145 144 for _, val in pairs(tmpTreasure) do
146   - if tmpBase >= val.treasure_value then
147   - tmpBase = tmpBase - val.treasure_value
  145 + if treasureBase >= val.treasure_value then
148 146 tmp[val.id] = val
149 147 end
150 148 end
... ... @@ -155,8 +153,6 @@ function DailyPlugin.bind(Daily)
155 153  
156 154 treasure = tmp[id]
157 155 if treasureBase < treasure.treasure_value then break end
158   - --扣除资源值
159   - treasureBase = treasureBase - treasure.treasure_value
160 156  
161 157 local chapterId = math.randWeight(chapters, "treasure_weight") --关卡id
162 158 if not chapterId then break end
... ... @@ -164,6 +160,8 @@ function DailyPlugin.bind(Daily)
164 160 treasure.chapter_id = chapterId
165 161 treasureList[treasure.id] = treasure
166 162  
  163 + --扣除资源值
  164 + treasureBase = treasureBase - treasure.treasure_value
167 165 tmpTreasure[treasure.id] = nil
168 166 chapters[chapterId] = nil
169 167 end
... ...