This commit is contained in:
xiekaidong 2023-04-26 18:41:24 +08:00
parent 2d1ab5421d
commit 0de502ba07

View File

@ -149,18 +149,23 @@ function ServerDataManager:dealGM(params, callback)
end end
end end
elseif args[1] == "pass_chapter" then elseif args[1] == "pass_chapter" then
local id = tonumber(args[2]) local maxId = tonumber(args[2])
if not id then if not maxId then
return return
end end
local cfg = ConfigManager:getConfig("chapter") local cfg = ConfigManager:getConfig("chapter")
for id, info in ipairs(cfg) do for id, info in ipairs(cfg) do
if id > maxId then
break
end
local maxWave = info.box_num[#info.box_num] local maxWave = info.box_num[#info.box_num]
if maxWave then if maxWave then
ServerGameData.ChapterData:fightChapter(id, true, maxWave) ServerGameData.ChapterData:fightChapter(id, true, maxWave)
end end
ServerGameData.HeroData:tryUnlockHeroByChapterId(id)
end end
ServerGameData.ChapterData.data.maxChapterId = id ServerGameData.ChapterData.data.maxChapterId = maxId
end end
ServerGameData:saveData() ServerGameData:saveData()