Jump to content

Recommended Posts

Don't forget to remove Multiplayer because of hacks.

 

Yeah, I mean, connecting to a remote computer on the internet, this so called "server", and letting it dictate to my game where the objects in the game should be? Not on my watch.

Share this post


Link to post
Share on other sites

That's beside the point - of course it crashes the game, it eats all the memory with boilerplate for recursion. If it is well optimized (so-called tail recursion), it just hangs indefinitely.

 

It was meant to be sarcastic showing that both isNil and call, one of the most frequently used commands, can crash the game when used in the exact same way. But once again sarcasm doesn't convey very well in written form.

 

 

Probably won't be recursion related though, the following works just fine:

0 = [] spawn {
    _code = {
        if (_this >= 10000) exitWith { systemchat str _this };
        (_this+1) call _code;
    };
    isNil { 0 call _code };
};

 

It is noteworthy that you're using call for recursion here. A call stack frame is implemented as a heap object, and as such recursion depth is limited only by available system memory. In the case of isNil however, a native stack frame is created, meaning the program will end in stack overflow at a much lower recursion depth.

Share this post


Link to post
Share on other sites

Worthy though this is, could we get this back on topic?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×