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?
On pc.h
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;}Share this post
Link to post
Share on other sites