ID:147248
 
Not sure what happened last night, but while hosting LJR-RPG it crashed. The only message I saw repeatly was respawn() which is the quick and easy what I refresh the monsters in my game on a time. Before the upgrade to 340, I never saw this error. It suggest setting world.loop_checks=0 to avoid the error again. Anyone here have an idea of what happened?

Here is the code that respawn, see anything wrong?
// Mob Spawner
proc/respawn()
world.Repop()
sleep(rand(5000,8000))
respawn()
world
New()
respawn()

LJR
LordJR wrote:
Here is the code that respawn, see anything wrong?
// Mob Spawner
proc/respawn()
world.Repop()
sleep(rand(5000,8000))
respawn()
world
New()
respawn()

LJR

Yep. You're having a proc recursively call itself without using spawn(). None of your respawn() procs ever finish, so DS hogs more and more memory until you get a crash, or some other undesired effect.

Instead of calling respawn(), do "spawn() respawn()". That way the current respawn() proc finishes, and then the next respawn() is called.
Jon88's correct. Those infinite loops always need watching. =)

LordJR wrote:
It suggest setting world.loop_checks=0 to avoid the error again.

Don't do it! DON'T DO IT! IT'S A TRAP! =P Seriously though, setting world.loop_checks=0 is almost always a bad idea.