digdug wrote:Question: does it mean that the function loop is going to crash after 1944 loops ?
Pretty much, but it isnt due to the loop-like nature, but to the repeated nesting of function calls
If function1 calls function2 which calls function3 which calls
<I am not going to type ~2000 of these>
which calls function2000
then it will throw an exception (the game should continue, but the functions leading up to the exception will be aborted).
In a rough sense: when a function returns, it needs to know where to return to. That means storing the "return here" details for each function call, and that storage can run out of room. The exact time at which it runs out varies depending on circumstances. Working directly from the Debug Console, I got about 2050 recursions before the exception.