I have a mod that generates a hash for the items, so, to not bug the hash when remove the card, I made a little change. However, I updated the emulator and in the last version, I'm having problems with this change. Could you help me?
ERROR:
script.c: In function âbuildin_successremovecardsâ:
script.c:11136: error: âstruct itemâ has no member named âitem_hashâ
script.c:11136: warning: zero-length printf format string
script.c:11156: error: âstruct itemâ has no member named âitem_hashâ
script.c:11156: error: âstruct itemâ has no member named âitem_hashâ
make[1]: *** [obj_sql/script.o] Error 1
/// Removes all cards from the item found in the specified equipment slot of the invoking character,
/// and give them to the character. If any cards were removed in this manner, it will also show a success effect.
Question
Siberian
I have a mod that generates a hash for the items, so, to not bug the hash when remove the card, I made a little change. However, I updated the emulator and in the last version, I'm having problems with this change. Could you help me?
ERROR:
/// Removes all cards from the item found in the specified equipment slot of the invoking character,
/// and give them to the character. If any cards were removed in this manner, it will also show a success effect.
/// successremovecards <slot>;
BUILDIN_FUNC(successremovecards) {
int i=-1,j,c,cardflag=0;
TBL_PC* sd = script_rid2sd(st);
int num = script_getnum(st,2);
if (num > 0 && num <= ARRAYLENGTH(equip))
i=pc_checkequip(sd,equip[num-1]);
if (i < 0 || !sd->inventory_data) {
return 0;
}
if(itemdb_isspecial(sd->status.inventory.card[0]))
return 0;
for( c = sd->inventory_data->slot - 1; c >= 0; --c ) {
if( sd->status.inventory.card[c] && itemdb_type(sd->status.inventory.card[c]) == IT_CARD ) {// extract this card from the item
int flag;
struct item item_tmp;
memset(&item_tmp,0,sizeof(item_tmp));
cardflag = 1;
item_tmp.nameid = sd->status.inventory.card[c];
item_tmp.identify = 1;
sprintf(item_tmp.item_hash, ""); <---- Linha 11136
item_tmp.favorite = 0;
if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){
clif_additem(sd,0,0,flag);
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
}
}
if(cardflag == 1) {
int flag;
struct item item_tmp;
memset(&item_tmp,0,sizeof(item_tmp));
item_tmp.nameid = sd->status.inventory.nameid;
item_tmp.identify = 1;
item_tmp.refine = sd->status.inventory.refine;
item_tmp.attribute = sd->status.inventory.attribute;
item_tmp.expire_time = sd->status.inventory.expire_time;
strcpy(item_tmp.item_hash, sd->status.inventory.item_hash); <---- Linha 11156
item_tmp.favorite = 0;
for (j = sd->inventory_data->slot; j < MAX_SLOTS; j++)
item_tmp.card[j]=sd->status.inventory.card[j];
pc_delitem(sd,i,1,0,3,LOG_TYPE_SCRIPT);
if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){
clif_additem(sd,0,0,flag);
map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
}
clif_misceffect(&sd->bl,3);
}
return 0;
}
Thanks.
Edited by Siberian1 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.