Originally Posted By: DLively
Is this required at the end of EVERY function?
No, but if you want to terminate function at the middle or right at the beggining (if something is wrong, f.e. empty pointer?) you can use it.

Originally Posted By: DLively
what if its occupying an action inside of a while loop? still return every frame?

Code:
function groove(ENTITY* ent){
    vec_set(ent.x, my.x);
    return;
}
action radio(){
    while(good_song == playing){wait(1);
        groove(player);
    }
}

As far as I know, your example will just run a function (groove), which will move player at 'radio' entity position and then terminate.. It will be the same as if 'return' wasn't there at all, that's not the way 'return' meant to be used. Return can also terminate function with a loop inside, but if there is a 'wait' inside of that loop, return won't be able to return any value (f.e. if you want to return a variable), because (as the manual says) 'wait' already returns to the calling function before the final return statement is excecuted.

Anyway, it's not for the first time I see you putting 'wait' at the beginning of the loop, and I wonder why?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung