Jump to content
  • 0

Compiling Error [ Source ]


SlashGeeGee

Question


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

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 ?

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  210
  • Reputation:   10
  • Joined:  11/20/11
  • Last Seen:  

show your script.c and the diff patch.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

Your script.c seem outdated. some call to log doesn't have the correct type.

Show us line :

7011 and 7020

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   104
  • Joined:  11/19/11
  • Last Seen:  

indside BUILDIN_FUNC(failedrefitemR) try to change log type

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

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

This is the same as removing the log_pick like I said, is up to you to know if you want to log those failerefine or not.

Link to comment
Share on other sites

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.

×
×
  • Create New...