From b62c0a4c60318d10a6f343b56db4edf1a361963f Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Wed, 9 Feb 2022 16:34:37 +0800 Subject: [PATCH] fix: 挂机图鉴,宝藏值使用不完全的问题 --- src/models/DailyPlugin.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/models/DailyPlugin.lua b/src/models/DailyPlugin.lua index 213d5d6..bf5b97e 100644 --- a/src/models/DailyPlugin.lua +++ b/src/models/DailyPlugin.lua @@ -141,10 +141,8 @@ function DailyPlugin.bind(Daily) local treasure while next(tmpTreasure or {}) do local tmp = {} - local tmpBase = treasureBase for _, val in pairs(tmpTreasure) do - if tmpBase >= val.treasure_value then - tmpBase = tmpBase - val.treasure_value + if treasureBase >= val.treasure_value then tmp[val.id] = val end end @@ -155,8 +153,6 @@ function DailyPlugin.bind(Daily) treasure = tmp[id] if treasureBase < treasure.treasure_value then break end - --扣除资源值 - treasureBase = treasureBase - treasure.treasure_value local chapterId = math.randWeight(chapters, "treasure_weight") --关卡id if not chapterId then break end @@ -164,6 +160,8 @@ function DailyPlugin.bind(Daily) treasure.chapter_id = chapterId treasureList[treasure.id] = treasure + --扣除资源值 + treasureBase = treasureBase - treasure.treasure_value tmpTreasure[treasure.id] = nil chapters[chapterId] = nil end -- libgit2 0.21.2