Commit 1b08afa754944e898da9c0a5eb587c70d4296533
1 parent
c32be356
修复拾荒结算时,返还药剂错误导致药水被吞的bug
Showing
1 changed file
with
4 additions
and
6 deletions
Show diff stats
src/adv/Adv.lua
@@ -812,14 +812,12 @@ function Adv:over(success, rewardRatio, overType) | @@ -812,14 +812,12 @@ function Adv:over(success, rewardRatio, overType) | ||
812 | local potionBag = self.owner:getProperty("potionBag") | 812 | local potionBag = self.owner:getProperty("potionBag") |
813 | for itemId, count in pairs(self.owner:getProperty("advItems"):toNumMap()) do | 813 | for itemId, count in pairs(self.owner:getProperty("advItems"):toNumMap()) do |
814 | local itemCsv = csvdb["itemCsv"][itemId] | 814 | local itemCsv = csvdb["itemCsv"][itemId] |
815 | - if not itemCsv then | 815 | + if advPotionCsv[itemId] then |
816 | + potionBag[itemId] = (potionBag[itemId] or 0) + count | ||
817 | + elseif not itemCsv then | ||
816 | print("ERROR: no itemId in ItemCsv : ", itemId) | 818 | print("ERROR: no itemId in ItemCsv : ", itemId) |
817 | elseif itemCsv.type ~= ItemType.AdvItem then | 819 | elseif itemCsv.type ~= ItemType.AdvItem then |
818 | - if advPotionCsv[itemId] then | ||
819 | - potionBag[itemId] = (potionBag[itemId] or 0) + count | ||
820 | - else | ||
821 | - reward[itemId] = math.ceil(count * rewardRatio / 100) | ||
822 | - end | 820 | + reward[itemId] = math.ceil(count * rewardRatio / 100) |
823 | end | 821 | end |
824 | end | 822 | end |
825 | reward = self.owner:award(reward, {log = {desc = "advOver", int1 = self.chapterId}}) | 823 | reward = self.owner:award(reward, {log = {desc = "advOver", int1 = self.chapterId}}) |