mob/verb/Loops()
infiniteLoop()
proc/infiniteLoop()
sleep(20)
spawn() infiniteLoop()
Problem description:
This may or may not just get closed since I've already submitted this as a bug report, but eh. BYOND tends to not fix my bugs, or at least not fix them soon. But anyway, the issue is that I have a loop that I call this way that crashes without an error after about a day and a half, so I need a way of doing this that does not crash. The bug report is here if you want to see what the problem is.
Essentially, any infinite loop that I call from world/New() crashes eventually. I thought it was just fine to do while(1) and let it go forever, as long as you didn't want to execute any code after the while loop started. If I'm wrong about that, replying to this post will be easy, but otherwise I'm wondering if anyone has had problems with calling infinite loops from world/New.
I've used infinite loops in projects before, and they can be especially handy in games that are hosted for days or weeks at a time, but I've never had problems with them silently crashing like this. And it's not my loop; I originally had one loop that was doing two completely different things at different rates, and I split it into two loops to see if one half of it was crashing, but they both eventually crash if I do that, and not at the same time. Currently I've got it back to one loop, and it just all happens inside world/New() in a while(1) instead of spawning and calling another function, because I thought spawning was the issue, since spawning causes the issue described in my bug report, but the procedure eventually crashes anyway.
Making a hidden admin verb that started the infinite loop wouldn't fix this, would it? I wouldn't do that permanently, but since I'm assuming that BYOND bug is related to my loops crashing, if someone thinks that'd work I might try it. These loops take at least half a day to crash, though, so it's kinda hard to debug.
The spawn() is important since MyLoop() never ends you'll want to execute it without it blocking the rest of the code. What you're doing is recursion, not really a loop.