Commit abe0d7e9772f795df1a806e18e63b85f77b97f77

Authored by zhouhaihai
1 parent c7ecb87f

连续选择点bug

Showing 1 changed file with 7 additions and 6 deletions   Show diff stats
src/adv/Adv.lua
... ... @@ -1010,13 +1010,14 @@ end
1010 1010 local function clickLinkChoose(self, room, block, params)
1011 1011 local choose = params.choose
1012 1012 local chooseData = csvdb["event_linkchooseCsv"][block.event.id]
  1013 + local lcId = block.event.id
1013 1014 local status, clearBlock = chooseCommon(self, room, block, chooseData, choose, "link")
1014 1015 if not status then return end
1015 1016  
1016 1017 -- 完成统计次数
1017   - local idx = block.event.id % 10
1018   - if idx == 9 or not csvdb["event_linkchooseCsv"][block.event.id + 1] then --全部完成
1019   - local startId = math.floor(block.event.id / 10) * 10 + 1
  1018 + local idx = lcId % 10
  1019 + if idx == 9 or not csvdb["event_linkchooseCsv"][lcId + 1] then --全部完成
  1020 + local startId = math.floor(lcId / 10) * 10 + 1
1020 1021 self.lchoose[startId] = (self.lchoose[startId] or 0) + 1
1021 1022 self:checkAchievement(Adv.AchievType.LinkChoose, 1, startId)
1022 1023 self:checkAchievement(Adv.AchievType.FinishStoryId, 1, chooseData.storyid)
... ... @@ -1028,13 +1029,13 @@ local function clickLinkChoose(self, room, block, params)
1028 1029  
1029 1030 self:checkAdvUnlock(4, startId)
1030 1031 self.lchoose.cur = self.lchoose.cur or {}
1031   - table.insert(self.lchoose.cur, {block.event.id, choose})
  1032 + table.insert(self.lchoose.cur, {lcId, choose})
1032 1033 self:pushBackEvent(AdvBackEventType.LinkChooseOver, self.lchoose.cur)
1033 1034 self.lchoose.cur = nil
1034 1035 else
1035   - self.lchoose.ing = block.event.id + 1 --后面会出现后继事件
  1036 + self.lchoose.ing = lcId + 1 --后面会出现后继事件
1036 1037 self.lchoose.cur = self.lchoose.cur or {}
1037   - table.insert(self.lchoose.cur, {block.event.id, choose})
  1038 + table.insert(self.lchoose.cur, {lcId, choose})
1038 1039 end
1039 1040  
1040 1041 if clearBlock then
... ...