Fix some bugs
This commit is contained in:
@@ -334,6 +334,7 @@ do-- function DATA.saveReplay()
|
||||
seed=GAME.seed,
|
||||
setting=GAME.setting,
|
||||
mod=_getModList(),
|
||||
modPatch=GAME.modPatch,
|
||||
tasUsed=GAME.tasUsed,
|
||||
}
|
||||
if GAME.curMode.savePrivate then
|
||||
@@ -393,6 +394,7 @@ function DATA.parseReplayData(fileName,fileData,ifFull)
|
||||
seed=metaData.seed,
|
||||
setting=metaData.setting,
|
||||
mod=metaData.mod,
|
||||
modPatch=metaData.modPatch,
|
||||
tasUsed=metaData.tasUsed,
|
||||
}
|
||||
if ifFull then rep.data=fileData end
|
||||
|
||||
@@ -666,14 +666,6 @@ function gameOver()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Kill mod patching function
|
||||
if GAME.ApplyModsTask then
|
||||
TASK.removeTask_code(GAME.ApplyModsTask)
|
||||
TABLE.cut(GAME.modCodeList)
|
||||
GAME.modCodeList=nil
|
||||
GAME.ApplyModsTask=nil
|
||||
end
|
||||
end
|
||||
function trySave()
|
||||
if not GAME.statSaved and PLAYERS[1] and PLAYERS[1].type=='human' and (PLAYERS[1].frameRun>300 or GAME.result) then
|
||||
|
||||
@@ -212,12 +212,17 @@ local function _loadGameEnv(P)-- Load gameEnv
|
||||
|
||||
if not GAME.ApplyModsTask then
|
||||
GAME.ApplyModsTask=function()
|
||||
while true do
|
||||
while GAME.playing do
|
||||
for _,p in pairs(GAME.modCodeList) do
|
||||
for _,c in pairs(p) do pcall(c) end
|
||||
end
|
||||
coroutine.yield()
|
||||
end
|
||||
-- Kill mod patching function when game stopped
|
||||
TASK.removeTask_code(GAME.ApplyModsTask)
|
||||
TABLE.cut(GAME.modCodeList)
|
||||
GAME.modCodeList=nil
|
||||
GAME.ApplyModsTask=nil
|
||||
end
|
||||
TASK.new(GAME.ApplyModsTask)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user