Commit b62c0a4c60318d10a6f343b56db4edf1a361963f
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,10 +141,8 @@ function DailyPlugin.bind(Daily) | ||
141 | local treasure | 141 | local treasure |
142 | while next(tmpTreasure or {}) do | 142 | while next(tmpTreasure or {}) do |
143 | local tmp = {} | 143 | local tmp = {} |
144 | - local tmpBase = treasureBase | ||
145 | for _, val in pairs(tmpTreasure) do | 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 | tmp[val.id] = val | 146 | tmp[val.id] = val |
149 | end | 147 | end |
150 | end | 148 | end |
@@ -155,8 +153,6 @@ function DailyPlugin.bind(Daily) | @@ -155,8 +153,6 @@ function DailyPlugin.bind(Daily) | ||
155 | 153 | ||
156 | treasure = tmp[id] | 154 | treasure = tmp[id] |
157 | if treasureBase < treasure.treasure_value then break end | 155 | if treasureBase < treasure.treasure_value then break end |
158 | - --扣除资源值 | ||
159 | - treasureBase = treasureBase - treasure.treasure_value | ||
160 | 156 | ||
161 | local chapterId = math.randWeight(chapters, "treasure_weight") --关卡id | 157 | local chapterId = math.randWeight(chapters, "treasure_weight") --关卡id |
162 | if not chapterId then break end | 158 | if not chapterId then break end |
@@ -164,6 +160,8 @@ function DailyPlugin.bind(Daily) | @@ -164,6 +160,8 @@ function DailyPlugin.bind(Daily) | ||
164 | treasure.chapter_id = chapterId | 160 | treasure.chapter_id = chapterId |
165 | treasureList[treasure.id] = treasure | 161 | treasureList[treasure.id] = treasure |
166 | 162 | ||
163 | + --扣除资源值 | ||
164 | + treasureBase = treasureBase - treasure.treasure_value | ||
167 | tmpTreasure[treasure.id] = nil | 165 | tmpTreasure[treasure.id] = nil |
168 | chapters[chapterId] = nil | 166 | chapters[chapterId] = nil |
169 | end | 167 | end |