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