handle missing config lines with defaults
This commit is contained in:
+3
-3
@@ -160,10 +160,10 @@ end
|
|||||||
|
|
||||||
function load_config()
|
function load_config()
|
||||||
sr = fs.open("reactorconfig.txt", "r")
|
sr = fs.open("reactorconfig.txt", "r")
|
||||||
autoInputGate = tonumber(sr.readLine())
|
autoInputGate = tonumber(sr.readLine()) or 1
|
||||||
curInputGate = tonumber(sr.readLine())
|
curInputGate = tonumber(sr.readLine()) or 222000
|
||||||
targetOutput = tonumber(sr.readLine())
|
targetOutput = tonumber(sr.readLine())
|
||||||
autoOutputGate = tonumber(sr.readLine())
|
autoOutputGate = tonumber(sr.readLine()) or 0
|
||||||
sr.close()
|
sr.close()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user