diff --git a/src/adv/Adv.lua b/src/adv/Adv.lua index 680e012..2b587ff 100644 --- a/src/adv/Adv.lua +++ b/src/adv/Adv.lua @@ -812,14 +812,12 @@ function Adv:over(success, rewardRatio, overType) local potionBag = self.owner:getProperty("potionBag") for itemId, count in pairs(self.owner:getProperty("advItems"):toNumMap()) do local itemCsv = csvdb["itemCsv"][itemId] - if not itemCsv then + if advPotionCsv[itemId] then + potionBag[itemId] = (potionBag[itemId] or 0) + count + elseif not itemCsv then print("ERROR: no itemId in ItemCsv : ", itemId) elseif itemCsv.type ~= ItemType.AdvItem then - if advPotionCsv[itemId] then - potionBag[itemId] = (potionBag[itemId] or 0) + count - else - reward[itemId] = math.ceil(count * rewardRatio / 100) - end + reward[itemId] = math.ceil(count * rewardRatio / 100) end end reward = self.owner:award(reward, {log = {desc = "advOver", int1 = self.chapterId}}) -- libgit2 0.21.2