SRL Archive - SRL Bugs

NextPlayer


Er1k

2012-05-26 05:54:42

I have searched and read an old thread here - http://villavu.com/forum/showthread.php?t=55073&highlight=nextplayer

The thing that I just don't understand is why does it leave the script in an infinite loop when all players are inactive. Why doesn't it just terminate the script? I am asking because this traps scripts inside infinite loops when it seems unnecessary and it somewhat hinders restarting with SMARTManager/CrashSMART.

Would be nice if devs could explain why the code is made that way ;) Btw it's 2012, will there be any chance this is possibly changed?

mormonman

2012-05-26 05:57:01

In that same thread RM shows how to avoid the infinite loop.

Er1k

2012-05-26 06:59:50

From: mormonman
In that same thread RM shows how to avoid the infinite loop.


Ah missed that! Was never used to looking at .SCAR code blocks. Just thought it's something else ;)

SRL_Procs[srl_InNextPlayerLoop] := @ScriptTerminate;
//then this will make some sense
if (SRL_Procs[srl_InNextPlayerLoop] <> nil) then
SRL_Procs[srl_InNextPlayerLoop]();

Thanks mormonman!