修复没有自定义游戏的场地数据等文件在启动时会直接报错
This commit is contained in:
14
main.lua
14
main.lua
@@ -81,7 +81,7 @@ PLY= require'parts.player'
|
|||||||
netPLY= require'parts.netPlayer'
|
netPLY= require'parts.netPlayer'
|
||||||
MODES= require'parts.modes'
|
MODES= require'parts.modes'
|
||||||
|
|
||||||
--Initialize field
|
--Initialize fields, sequence, missions, gameEnv for cutsom game
|
||||||
local fieldData=FILE.load('conf/customBoards')
|
local fieldData=FILE.load('conf/customBoards')
|
||||||
if fieldData then
|
if fieldData then
|
||||||
fieldData=STRING.split(fieldData,"!")
|
fieldData=STRING.split(fieldData,"!")
|
||||||
@@ -91,12 +91,12 @@ if fieldData then
|
|||||||
else
|
else
|
||||||
FIELD[1]=DATA.newBoard()
|
FIELD[1]=DATA.newBoard()
|
||||||
end
|
end
|
||||||
DATA.pasteSequence(FILE.load('conf/customSequence'))
|
local sequenceData=FILE.load('conf/customSequence')
|
||||||
DATA.pasteMission(FILE.load('conf/customMissions'))
|
if sequenceData then DATA.pasteSequence(sequenceData)end
|
||||||
local customData=FILE.load('conf/customEnv')--gameEnv for cutsom game
|
local missionData=FILE.load('conf/customMissions')
|
||||||
if customData or CUSTOMENV.version~=VERSION.code then
|
if missionData then DATA.pasteMission(missionData)end
|
||||||
TABLE.complete(customData,CUSTOMENV)
|
local customData=FILE.load('conf/customEnv')
|
||||||
end
|
if customData or CUSTOMENV.version~=VERSION.code then TABLE.complete(customData,CUSTOMENV)end
|
||||||
TABLE.complete(require"parts.customEnv0",CUSTOMENV)
|
TABLE.complete(require"parts.customEnv0",CUSTOMENV)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user