termination fix pt1
This commit is contained in:
16
main.lua
16
main.lua
@@ -783,7 +783,21 @@ function Main()
|
|||||||
local event = nil
|
local event = nil
|
||||||
local function getTerminateEvent()
|
local function getTerminateEvent()
|
||||||
event = os.pullEventRaw("terminate")
|
event = os.pullEventRaw("terminate")
|
||||||
if event == "terminate" then print("Terminate Event Received") WriteConfigFiles() end
|
if event == "terminate" then
|
||||||
|
print("Terminate Event Received")
|
||||||
|
|
||||||
|
print("Writing to thruster config file.")
|
||||||
|
local thrusterConfigFile = fs.open(Config.thrusterConfigPath, "w+")
|
||||||
|
thrusterConfigFile.write(tableToString(Thrusters))
|
||||||
|
thrusterConfigFile.close()
|
||||||
|
|
||||||
|
print("Writing to config file")
|
||||||
|
local configFile = fs.open(Config.ConfigPath, "w+")
|
||||||
|
configFile.write(tableToString(Config))
|
||||||
|
configFile.close()
|
||||||
|
else
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function do_sleep() os.sleep(0.1) end
|
local function do_sleep() os.sleep(0.1) end
|
||||||
|
|||||||
Reference in New Issue
Block a user