termination fix pt1

This commit is contained in:
2026-06-25 15:56:04 -05:00
parent 440151eadc
commit 1c13ea58e5

View File

@@ -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