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)
Question
Siberian
Before I compiled without problems, now I'm having this problem. Anyone know how to solve this?
ERROR:
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 SiberianLink to comment
Share on other sites
2 answers 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.