From f0de8a60203678f3488f9a117425f8656a5eb84f Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Thu, 6 May 2021 15:02:15 +0800 Subject: [PATCH] 挖宝跨天,前一天天正在挖的宝被刷掉的bug ——没在挖的宝才刷新,资源值重置 --- src/models/Daily.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/models/Daily.lua b/src/models/Daily.lua index af8f2fd..fbc4ab5 100644 --- a/src/models/Daily.lua +++ b/src/models/Daily.lua @@ -33,6 +33,7 @@ Daily.schema = { curPool = {"number", 0}, -- 属性卡池当前索引 drawHeroCnt = {"number", 0}, -- 每日抽卡次数 + treasureBase = {"number", 0}, -- 资源值 treasureList = {"table", {}}, --挂机图鉴 } @@ -142,8 +143,6 @@ function Daily:checkTreasureExpired(treasureAttr, treasureList) end curInfo = clone(treasureAttr) end - else - curInfo = clone(treasureAttr) end else curInfo = clone(treasureAttr) @@ -303,7 +302,7 @@ end function Daily:buyTreasure(treasureList) local boughtTreasurer = {} - local treasureBase = globalCsv.idle_treasure_base + local treasureBase = self:getProperty("treasureBase") for id, val in pairs(treasureList) do treasureBase = treasureBase - val.treasure_value if treasureBase < 0 then @@ -313,7 +312,7 @@ function Daily:buyTreasure(treasureList) boughtTreasurer[id] = val end end - --self:updateProperty({field = "treasureBase", value = treasureBase}) + self:updateProperty({field = "treasureBase", value = treasureBase}) return boughtTreasurer end @@ -340,6 +339,7 @@ function Daily:getTreasrueList() self:checkTreasureWeight(treasureList, tmptreasure, treasureBase) self:updateProperty({field = "treasureList", value = treasureList}) + self:updateProperty({field = "treasureBase", value = treasureBase}) return treasureList end -- libgit2 0.21.2