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
elseif args[1] == "pass_chapter" then
local id = tonumber(args[2])
if not id then
local maxId = tonumber(args[2])
if not maxId then
return
end
local cfg = ConfigManager:getConfig("chapter")
for id, info in ipairs(cfg) do
if id > maxId then
break
end
local maxWave = info.box_num[#info.box_num]
if maxWave then
ServerGameData.ChapterData:fightChapter(id, true, maxWave)
end
ServerGameData.HeroData:tryUnlockHeroByChapterId(id)
end
ServerGameData.ChapterData.data.maxChapterId = id
ServerGameData.ChapterData.data.maxChapterId = maxId
end
ServerGameData:saveData()