Jump to content
  • 0

Compiling Error (16854) - custom mod


Siberian

Question


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   0
  • Joined:  02/07/12
  • Last Seen:  

Before I compiled without problems, now I'm having this problem. Anyone know how to solve this?

ERROR:

pc.c: In function âpc_statusup3â:
pc.c:5757: warning: implicit declaration of function âpc_getstatâ
pc.c:5764: warning: implicit declaration of function âpc_setstatâ
pc.c: At top level:
pc.c:5811: error: static declaration of âpc_getstatâ follows non-static declaration
pc.c:5757: error: previous implicit declaration of âpc_getstatâ was here
pc.c:5829: error: static declaration of âpc_setstatâ follows non-static declaration
pc.c:5764: error: previous implicit declaration of âpc_setstatâ was here
make[1]: *** [obj_sql/pc.o] Error 1

int pc_statusup3(struct map_session_data* sd, int type, int amount)
{
int max, need, val;
nullpo_ret(sd);
// check conditions
need = pc_need_status_point(sd,type,amount);
if( type < SP_STR || type > SP_LUK || need < 0 || need > sd->status.status_point )
{
 clif_statusupack(sd,type,0,0);
 return 1;
}
// check limits
max = pc_maxparameter(sd);
if( pc_getstat(sd,type) >= max )
{
 clif_statusupack(sd,type,0,0);
 return 1;
}
// set new values
val = pc_setstat(sd, type, pc_getstat(sd,type) + amount);
sd->status.status_point -= need;
status_calc_pc(sd,0);
// update increase cost indicator
if( need != pc_need_status_point(sd,type,amount) )
 clif_updatestatus(sd, SP_USTR + type-SP_STR);
// update statpoint count
clif_updatestatus(sd,SP_STATUSPOINT);
// update stat value
clif_statusupack(sd,type,amount,val); // required
if( val > 255 )
 clif_updatestatus(sd,type); // send after the 'ack' to override the truncated value
return 0;
}

Line 5757: if( pc_getstat(sd,type) >= max )

Line 5764: val = pc_setstat(sd, type, pc_getstat(sd,type) + amount);

/// Returns the value of the specified stat.

static int pc_getstat(struct map_session_data* sd, int type)

{ <---- LINE 5811

nullpo_retr(-1, sd);

switch( type ) {

case SP_STR: return sd->status.str;

case SP_AGI: return sd->status.agi;

case SP_VIT: return sd->status.vit;

case SP_INT: return sd->status.int_;

case SP_DEX: return sd->status.dex;

case SP_LUK: return sd->status.luk;

default:

return -1;

}

}

/// Sets the specified stat to the specified value.

/// Returns the new value.

static int pc_setstat(struct map_session_data* sd, int type, int val)

{ <---- LINE 5829

nullpo_retr(-1, sd);

switch( type ) {

case SP_STR: sd->status.str = val; break;

case SP_AGI: sd->status.agi = val; break;

case SP_VIT: sd->status.vit = val; break;

case SP_INT: sd->status.int_ = val; break;

case SP_DEX: sd->status.dex = val; break;

case SP_LUK: sd->status.luk = val; break;

default:

return -1;

}

return val;

}

Thanks.

Edited by Siberian
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


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

put the declaration of

pc_getstat and pc_setstat

before usage.

either do it at begining of .c or move up fonction or put declaration in .h

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   0
  • Joined:  02/07/12
  • Last Seen:  

Thanks bro !!! Solved.

Please help me again ...

http://rathena.org/board/topic/73369-help-in-source-mod/

Thanks.

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...