From 361012b23b170a1e3cf7243e3632acef6465138a Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 25 Jun 2017 19:41:55 -0400 Subject: [PATCH] slight change for module creation (1.7.5) changed some things for threads --- multi/init.lua | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/multi/init.lua b/multi/init.lua index 0d26965..5df3b84 100644 --- a/multi/init.lua +++ b/multi/init.lua @@ -67,6 +67,7 @@ multi.jobUS=2 multi.clock=os.clock multi.time=os.time multi.LinkedPath=multi +mulit.isRunning=false multi.queuefinal=function(self) self:Destroy() if self.Parent.Mainloop[#self.Parent.Mainloop] then @@ -952,12 +953,17 @@ function multi:newCondition(func) end multi.NewCondition=multi.newCondition function multi:mainloop() - for i=1,#self.Tasks do - self.Tasks[i](self) - end - rawset(self,'Start',self.clock()) - while self.Active do - self:Do_Order() + if not mulit.isRunning then + mulit.isRunning=true + for i=1,#self.Tasks do + self.Tasks[i](self) + end + rawset(self,'Start',self.clock()) + while self.Active do + self:Do_Order() + end + else + return "Already Running!" end --print("Did you call multi:Stop()? This method should not be used when using multi:mainloop() unless of course you wanted to stop it! you can restart the multi, by using multi:reboot() and calling multi:mainloop() again or by using multi:uManager()") end