Jump to content
  • 0
Sign in to follow this  
Zirius

Detect all NPC file that uses goto

Question

I just want to avoid any future trouble, so I wanna ask if there's a way I can detect all NPC files that are using goto function. I have so many custom NPCs. Is there a way these goto function uses to show at my console so I can debug?

 

Thanks!

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

script.c

BUILDIN(goto){if( !data_islabel(script_getdata(st,2)) ){  ShowError("script:goto: not a labeln");  script->reportdata(script_getdata(st,2));  st->state = END;  return false;}ShowDebug("script.c: function 'goto' detected!n");st->pos = script_getnum(st,2);st->state = GOTO;return true;} 

:meow:

Share this post


Link to post
Share on other sites
  • 0

Why not just do a folder search with "goto"? Usually text editors provide such feature, like I know for sure both Notepad++ and Sublime Text have it via ctrl+shift+f (I use it pretty often, helps to find all the instances of something in specific folder. And if coupled with mass replace it helps even more, like I was able to switch to lowercase commands in all scripts quite easy).

Share this post


Link to post
Share on other sites
  • 0

Why not just do a folder search with "goto"? Usually text editors provide such feature, like I know for sure both Notepad++ and Sublime Text have it via ctrl+shift+f (I use it pretty often, helps to find all the instances of something in specific folder. And if coupled with mass replace it helps even more, like I was able to switch to lowercase commands in all scripts quite easy).

That's what I'm doing but sometimes false detect, *goto*

Share this post


Link to post
Share on other sites
  • 0

script.c

BUILDIN(goto){if( !data_islabel(script_getdata(st,2)) ){  ShowError("script:goto: not a labeln");  script->reportdata(script_getdata(st,2));  st->state = END;  return false;}ShowDebug("script.c: function 'goto' detected!n");st->pos = script_getnum(st,2);st->state = GOTO;return true;} 
:meow:

 

 

How can it also show the file name and location?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.