Jump to content
  • 0

Compiling Error [ Source ]


Question

Posted

Hello rAthena :D

I've made so many changes in source like the change max guild capacity , changing client date and +20 refine system, but when compiling i got error's.

here's the error show :


\rathena\src\map\script.c(7011) : error C2440: 'function' : cannot convert from 'char [2]' to 'e_log_pick_type'
\rathena\src\map\script.c(7011) : warning C4024: 'log_pick_pc' : different types for formal and actual parameter 2
\rathena\src\map\script.c(7011) : warning C4047: 'function' : 'item *' differs in levels of indirection from 'int'
\rathena\src\map\script.c(7011) : warning C4024: 'log_pick_pc' : different types for formal and actual parameter 4
\rathena\src\map\script.c(7011) : warning C4020: 'log_pick_pc' : too many actual parameters
\rathena\src\map\script.c(7020) : error C2440: 'function' : cannot convert from 'char [2]' to 'e_log_pick_type'
\rathena\src\map\script.c(7020) : warning C4024: 'log_pick_pc' : different types for formal and actual parameter 2
\rathena\src\map\script.c(7020) : warning C4047: 'function' : 'item *' differs in levels of indirection from 'int'
\rathena\src\map\script.c(7020) : warning C4024: 'log_pick_pc' : different types for formal and actual parameter 4
\rathena\src\map\script.c(7020) : warning C4020: 'log_pick_pc' : too many actual parameters

Thank You For Helping :D

Anyone know how to fix these errors ?

7 answers to this question

Recommended Posts

Posted

here's what i added in my script.c


/*==========================================
* ¸˜Bޏ”s
*------------------------------------------*/
BUILDIN_FUNC(failedrefitem)
{
int i=-1,num;
TBL_PC *sd;

num=script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
return 0;

if (num > 0 && num <= ARRAYLENGTH(equip))
i=pc_checkequip(sd,equip[num-1]);
if(i >= 0) {
sd->status.inventory[i].refine = 0;
pc_unequipitem(sd,i,3);
// ¸˜Bޏ”sƒGƒtƒFƒNƒg‚̃pƒPƒbƒg
clif_refine(sd->fd,1,i,sd->status.inventory[i].refine);

pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
// ‘¼‚Ìl‚É‚àŽ¸”s‚ð’Ê’m
clif_misceffect(&sd->bl,2);
}

return 0;
}

BUILDIN_FUNC(failedrefitemR) // by jakeRed
{
int i=-1,num;
TBL_PC *sd;

num=script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
return 0;

if (num > 0 && num <= ARRAYLENGTH(equip))
i=pc_checkequip(sd,equip[num-1]);
if(i >= 0) {

//Logs items, got from (N)PC scripts [Lupus]
if(log_config.enable_logs&0x40)
log_pick_pc(sd, "N", sd->status.inventory[i].nameid, -1, &sd->status.inventory[i]);

sd->status.inventory[i].refine = sd->status.inventory[i].refine - 3;
pc_unequipitem(sd,i,2); // status calc will happen in pc_equipitem() below

clif_refine(sd->fd,0,i,sd->status.inventory[i].refine);
clif_delitem(sd,i,1,2);

if(log_config.enable_logs&0x40)
log_pick_pc(sd, "N", sd->status.inventory[i].nameid, 1, &sd->status.inventory[i]);

clif_additem(sd,i,1,0);
clif_misceffect(&sd->bl,2);
}

return 0;
}

and this


BUILDIN_DEF(failedrefitem,"i"),
BUILDIN_DEF(failedrefitemR,"i"), //jakeRed

it's for the +20 Refiner :D

Posted (edited)

This are really old fonction style, rA/Ea don't use if(log_config_enable&0x40) stuf since r15245 and before for harcoded hexed value.

Now to fix your compilation you may do as QQfoolsorellina mentionned but in latest rathena it'd more be something like this :

//void log_pick_pc(struct map_session_data* sd, e_log_pick_type type, int amount, struct item* itm)

so you'll need to change both

//Logs items, got from (N)PC scripts [Lupus]
if(log_config.enable_logs&0x40)
log_pick_pc(sd, "N", sd->status.inventory[i].nameid, -1, &sd->status.inventory[i]);

to

log_pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i]);

and

if(log_config.enable_logs&0x40)

log_pick_pc(sd, "N", sd->status.inventory.nameid, 1, &sd->status.inventory);

to

log_pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i]);

or you can just remove thise since you don't really lose an item anyway, well take a look at the e_log_pick_type to chose the one you want.

and last you should update the failedrefitemR to read how much to downgrade the equipement instead hardcoding minus 3, (seem a bit wrong design here)

Edited by Lighta

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...