Jump to content
  • 0
Sign in to follow this  
AnyThing

setd no longer works with pc_readglobalreg

Question

On pc.h

 

 

#define pc_readglobalreg(sd,reg)         (pc->readregistry((sd),(reg)))#define pc_setglobalreg(sd,reg,val)      (pc->setregistry((sd),(reg),(val)))#define pc_readglobalreg_str(sd,reg)     (pc->readregistry_str((sd),(reg)))#define pc_setglobalreg_str(sd,reg,val)  (pc->setregistry_str((sd),(reg),(val)))#define pc_readaccountreg(sd,reg)        (pc->readregistry((sd),(reg)))#define pc_setaccountreg(sd,reg,val)     (pc->setregistry((sd),(reg),(val)))#define pc_readaccountregstr(sd,reg)     (pc->readregistry_str((sd),(reg)))#define pc_setaccountregstr(sd,reg,val)  (pc->setregistry_str((sd),(reg),(val)))#define pc_readaccountreg2(sd,reg)       (pc->readregistry((sd),(reg)))#define pc_setaccountreg2(sd,reg,val)    (pc->setregistry((sd),(reg),(val)))#define pc_readaccountreg2str(sd,reg)    (pc->readregistry_str((sd),(reg)))#define pc_setaccountreg2str(sd,reg,val) (pc->setregistry_str((sd),(reg),(val))) 

 

 

 

On old system, I can do pc_readglobalreg(sd, "variablename") and the data will be read from global_reg_value sql table.

 

But, ever since Hercules 1st mega update, setd command in npc script is now stored in char_reg_num_db sql table. The problem is now I can't read it anymore in a source by using pc_readglobalreg(sd, "variablename"). It will just return 0.

 

May I know what's the right source command now that can be used to retrieve the data in the source?

 

Ref:

http://herc.ws/board/topic/3886-hercules-1st-2014-megapatch/

http://herc.ws/wiki/PC_Readglobalreg

 

 

/** * Serves the following variable types: * - 'type' (permanent nuneric char reg) * - '#type' (permanent numeric account reg) * - '##type' (permanent numeric account reg2) **/int pc_readregistry(struct map_session_data *sd, int64 reg) {	struct script_reg_num *p = NULL;		if (!sd->vars_ok) {		ShowError("pc_readregistry: Trying to read reg %s before it's been loaded!n", script->get_str(script_getvarid(reg)));		//This really shouldn't happen, so it's possible the data was lost somewhere, we should request it again.		//intif->request_registry(sd,type==3?4:type);		set_eof(sd->fd);		return 0;	}		p = i64db_get(sd->regs.vars, reg);	return p ? p->value : 0;} 

 

Edited by AnyThing

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

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.