Commit 127a5787e8e6449e426cf1117db66daa16a3c03b

Authored by zhouhaihai
1 parent b992f1ca

商人卖完走人

Showing 1 changed file with 7 additions and 1 deletions   Show diff stats
src/adv/Adv.lua
... ... @@ -798,7 +798,8 @@ local function clickTrader(self, room, block, params)
798 798 if not block.event.shop or not block.event.shop[buyId] then return end
799 799 if (block.event.status or ""):getv(buyId, 0) == 1 then return end -- 买过了
800 800  
801   - if traderData.purchasetime <= #((block.event.status or ""):toArray()) then return end
  801 + local buyCount = #((block.event.status or ""):toArray())
  802 + if traderData.purchasetime <= buyCount then return end
802 803  
803 804 local goodsData = csvdb["event_trader_goodsCsv"][block.event.shop[buyId][1]]
804 805 if not goodsData then return end
... ... @@ -815,9 +816,14 @@ local function clickTrader(self, room, block, params)
815 816 self.owner:updateProperty({field = "advShop", value = advShop})
816 817 end
817 818 block.event.status = block.event.status:setv(buyId, 1)
  819 + buyCount = buyCount + 1
818 820 self:checkTask(Adv.TaskType.Shop, 1, block.event.id)
819 821 self:checkAchievement(Adv.AchievType.Shop, 1, block.event.id)
820 822 self:backReward(reward)
  823 +
  824 + if traderData.purchasetime <= buyCount or #block.event.shop <= buyCount then
  825 + block:clear()
  826 + end
821 827 return true
822 828 end
823 829  
... ...