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