From 82d6a78a6ab59efdf3b5ce03e0f71ba9116b7c06 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Fri, 16 Jun 2023 11:48:57 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/userdata/chapter/chapter_data.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/app/userdata/chapter/chapter_data.lua b/lua/app/userdata/chapter/chapter_data.lua index 3f1b3d72..32d5e814 100644 --- a/lua/app/userdata/chapter/chapter_data.lua +++ b/lua/app/userdata/chapter/chapter_data.lua @@ -283,8 +283,12 @@ function ChapterData:getChapterPassed(chapterId) end function ChapterData:openBox(chapterId, index) - if not self.data.chapterInfo[chapterId] or not self.data.chapterInfo[chapterId].index then - return + if not self.data.chapterInfo[chapterId] then + self.data.chapterInfo[chapterId] = { + total_count = 0, + index = {}, + mystery_box_idx = {} + } end for _, idx in ipairs(self.data.chapterInfo[chapterId].index) do if idx == index then