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