Jump to content
  • 0
e0706

pc->delitem args is invalid when pre hooking

Question

int my_pc_delitem_pre(struct map_session_data *sd,int n,int amount,int type, short reason, e_log_pick_type log_type)
{
my_pc_delitem_storage = 0;
ShowError("!!!!! %d !!!!!n", n);
return 1;
}
 
output is !!!!! 162561 !!!!!
 
item count is 3 in inventory.
 
how fix it?
 
sorry, i bad eng...
Edited by e0706

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

@@Aeromesi, next time mention my name lol

 

@@e0706,

I have same problem long time ago

http://herc.ws/board/topic/7108-hpm-hooking-return-random-value-from-the-defined-function/

 

all the value has to add start (*) symbol

int my_pc_delitem_pre(struct map_session_data *sd,int *n,int *amount,int *type, short *reason, e_log_pick_type *log_type)
then also retrieve them with the (*) symbol

ShowDebug( "%d", *amount );

Share this post


Link to post
Share on other sites
  • 0

Explanation:

All parameter (in function) for Plugins are pointers, so with pointers, one can change data and that will be changed in original function too.

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...

×
×
  • Create New...

Important Information

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