Jump to content
  • 0
Sign in to follow this  
GmOcean

HPM Hooking into a switch

Question

So, what I want to know how to do is, hook into certain parts of code where it does has a switch(case:).

 

How would I do that if it's even possible. Or do I have to just copy paste all of the code into a plugin, and add my custom code as well, so that it completely overrides it?

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

AFAIK, you can't hook onto an arbitrary point in a function, just pre or post hook it. I guess if you want to change an intermediate value you would have to posthook it, recheck for your case and, of necessary, redo all important code that use that result as an intermediate result.

Share this post


Link to post
Share on other sites
  • 0

Well it depends on how complex the the function you want to hook in..but there is other way you can do it..

 

 

temp_function(x);modified_function(x){ switch(x){   case myedit: break   default:      temp_function(x); }}temp_function = original_function;original_function = modified_function;

 

:meow:

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.