From c32be3563bd4b512c28fbc7b2fe9ad7ca7d24503 Mon Sep 17 00:00:00 2001 From: chenyueqi Date: Thu, 28 Jan 2021 10:24:06 +0800 Subject: [PATCH] 进入拾荒自动补给药水,按当前等级下的携带最大数量计算 --- src/adv/Adv.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/adv/Adv.lua b/src/adv/Adv.lua index 9229024..680e012 100644 --- a/src/adv/Adv.lua +++ b/src/adv/Adv.lua @@ -1125,10 +1125,12 @@ function Adv:supplyPotion() local potionCsv = csvdb["adv_potionCsv"] local potionBag = self.owner:getProperty("potionBag") local advItems = self.owner:getProperty("advItems") + local dishTree = self.owner.dinerData:getProperty("dishTree") for potionId, set in pairs(potionCsv) do local count = potionBag[potionId] or 0 if count > 0 then - local num = math.min(set[1].limit,count) + local level = dishTree:getv(potionId,1) + local num = math.min(set[level].limit,count) advItems = advItems:setv(potionId,num) potionBag[potionId] = num ~= count and (count - num) or nil end -- libgit2 0.21.2