|
@@ -9611,7 +9611,7 @@ char* pc_readregistry_str(struct map_session_data *sd, int64 reg)
|
|
* - '#type' (permanent numeric account reg)
|
|
* - '#type' (permanent numeric account reg)
|
|
* - '##type' (permanent numeric account reg2)
|
|
* - '##type' (permanent numeric account reg2)
|
|
**/
|
|
**/
|
|
-int pc_setregistry(struct map_session_data *sd, int64 reg, int64 val)
|
|
|
|
|
|
+bool pc_setregistry(struct map_session_data *sd, int64 reg, int64 val)
|
|
{
|
|
{
|
|
struct script_reg_num *p = NULL;
|
|
struct script_reg_num *p = NULL;
|
|
const char *regname = get_str(script_getvarid(reg));
|
|
const char *regname = get_str(script_getvarid(reg));
|
|
@@ -9619,7 +9619,7 @@ int pc_setregistry(struct map_session_data *sd, int64 reg, int64 val)
|
|
|
|
|
|
if ( !reg_load && !sd->vars_ok ) {
|
|
if ( !reg_load && !sd->vars_ok ) {
|
|
ShowError("pc_setregistry : refusing to set %s until vars are received.\n", regname);
|
|
ShowError("pc_setregistry : refusing to set %s until vars are received.\n", regname);
|
|
- return 0;
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
|
|
|
|
if ((p = (struct script_reg_num *)i64db_get(sd->regs.vars, reg))) {
|
|
if ((p = (struct script_reg_num *)i64db_get(sd->regs.vars, reg))) {
|
|
@@ -9655,7 +9655,7 @@ int pc_setregistry(struct map_session_data *sd, int64 reg, int64 val)
|
|
if (!reg_load && p)
|
|
if (!reg_load && p)
|
|
sd->vars_dirty = true;
|
|
sd->vars_dirty = true;
|
|
|
|
|
|
- return 1;
|
|
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -9664,7 +9664,7 @@ int pc_setregistry(struct map_session_data *sd, int64 reg, int64 val)
|
|
* - '#type$' (permanent str account reg)
|
|
* - '#type$' (permanent str account reg)
|
|
* - '##type$' (permanent str account reg2)
|
|
* - '##type$' (permanent str account reg2)
|
|
**/
|
|
**/
|
|
-int pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val)
|
|
|
|
|
|
+bool pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val)
|
|
{
|
|
{
|
|
struct script_reg_str *p = NULL;
|
|
struct script_reg_str *p = NULL;
|
|
const char *regname = get_str(script_getvarid(reg));
|
|
const char *regname = get_str(script_getvarid(reg));
|
|
@@ -9673,13 +9673,13 @@ int pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val)
|
|
|
|
|
|
if (!reg_load && !sd->vars_ok) {
|
|
if (!reg_load && !sd->vars_ok) {
|
|
ShowError("pc_setregistry_str : refusing to set %s until vars are received.\n", regname);
|
|
ShowError("pc_setregistry_str : refusing to set %s until vars are received.\n", regname);
|
|
- return 0;
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
|
|
|
|
if ( !script_check_RegistryVariableLength(1, val, &vlen ) )
|
|
if ( !script_check_RegistryVariableLength(1, val, &vlen ) )
|
|
{
|
|
{
|
|
ShowError("pc_check_RegistryVariableLength: Variable value length is too long (aid: %d, cid: %d): '%s' sz=%zu\n", sd->status.account_id, sd->status.char_id, val, vlen);
|
|
ShowError("pc_check_RegistryVariableLength: Variable value length is too long (aid: %d, cid: %d): '%s' sz=%zu\n", sd->status.account_id, sd->status.char_id, val, vlen);
|
|
- return 0;
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
|
|
|
|
if( (p = (struct script_reg_str *)i64db_get(sd->regs.vars, reg) ) ) {
|
|
if( (p = (struct script_reg_str *)i64db_get(sd->regs.vars, reg) ) ) {
|
|
@@ -9722,7 +9722,7 @@ int pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val)
|
|
if( !reg_load && p )
|
|
if( !reg_load && p )
|
|
sd->vars_dirty = true;
|
|
sd->vars_dirty = true;
|
|
|
|
|
|
- return 1;
|
|
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|