Recursion - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Recursion (
/showthread.php?tid=638163)
Recursion -
TracerX - 27.07.2017
hello I've been facing a problem on my 39k~ line code, there's a recursion, I read that a recursion means a function calling itself in the same function, like this:
pawn Код:
FunctionX()
{
//Some code
FunctionX();
return 1;
}
well, I checked the code I added recently but I couldnt find smth similar so I was wondering if it could happen because of something else? I noticed that it lags my server as fuck. And if it is only because the function repeating itself, is there a way to find which function causes it? like any plugin or anything? Help would be really appreciated.
Re: Recursion -
Pottus - 27.07.2017
Profiler plugin
https://sampforum.blast.hk/showthread.php?tid=271129
Re: Recursion -
OneDay - 28.07.2017
Quote:
Originally Posted by TracerX
hello I've been facing a problem on my 39k~ line code, there's a recursion
|
why is that problem?
Re: Recursion -
TracerX - 29.07.2017
Quote:
Originally Posted by Pottus
|
how do I use it? I added profile_gamemode 1 in m server.cfg and used the include/plugin, nothing gets printed.
Quote:
Originally Posted by OneDay
why is that problem?
|
I believe it lags my server
Re: Recursion -
Logic_ - 29.07.2017
Possibly can, and works way too similarly to an infinite loop. What else can you expect? Might showing why and how are you using that function?
Re: Recursion -
iLearner - 29.07.2017
If you're using new compiler (the fast one) you need to put #pragma disable recursion under #include <a_samp>
Re: Recursion -
TracerX - 29.07.2017
Quote:
Originally Posted by Logic_
Possibly can, and works way too similarly to an infinite loop. What else can you expect? Might showing why and how are you using that function?
|
if I knew which function causes it, I'd have fixed it..