From 56c385d13f37a59758f2ae075554d9200d751a56 Mon Sep 17 00:00:00 2001 From: Ale32bit Date: Sun, 30 Oct 2016 21:47:53 +0100 Subject: [PATCH] Now init is safe from terminating --- src/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/init.lua b/src/init.lua index 5dba8e5..d30e2d5 100644 --- a/src/init.lua +++ b/src/init.lua @@ -1,3 +1,5 @@ +local old = os.pullEvent +os.pullEvent = os.pullEventRaw local function crash(err) if not sPhone then sPhone = { @@ -189,6 +191,8 @@ if argData["-s"] then runningOnStartup = true end +os.pullEvent = old + local ok, err = pcall(function() setfenv(loadstring(script),getfenv())() end) if not ok then