修复任务编辑(潜在)和序列编辑粘贴不当格式数据会有污染信息影响数据导致后续错误 closed #89

This commit is contained in:
MrZ626
2021-06-23 05:42:45 +08:00
parent 6c2cbe5f20
commit 5238d855b4
2 changed files with 6 additions and 6 deletions

View File

@@ -187,7 +187,7 @@ function DATA.copyMission()
end end
function DATA.pasteMission(str) function DATA.pasteMission(str)
local b local b
local mission={} TABLE.cut(MISSION)
local reg local reg
for i=1,#str do for i=1,#str do
b=byte(str,i) b=byte(str,i)
@@ -200,24 +200,23 @@ function DATA.pasteMission(str)
else else
if b>=34 and b<=114 then if b>=34 and b<=114 then
if missionEnum[reg]then if missionEnum[reg]then
ins(mission,reg) ins(MISSION,reg)
reg=b-33 reg=b-33
else else
TABLE.cut(MISSION)
return return
end end
elseif b>=115 and b<=126 then elseif b>=115 and b<=126 then
for _=1,b-113 do for _=1,b-113 do
ins(mission,reg) ins(MISSION,reg)
end end
reg=false reg=false
end end
end end
end end
if reg then if reg then
ins(mission,reg) ins(MISSION,reg)
end end
MISSION=mission
return true return true
end end

View File

@@ -100,6 +100,7 @@ function scene.keyDown(key)
MES.new('check',text.importSuccess) MES.new('check',text.importSuccess)
cur=#BAG cur=#BAG
else else
TABLE.cut(BAG)
MES.new('error',text.dataCorrupted) MES.new('error',text.dataCorrupted)
end end
elseif key=="escape"then elseif key=="escape"then