From 565bad1041b46f40c843121f1db915d95c76a9ad Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sat, 3 Oct 2009 10:42:20 -0600 Subject: Make failed skill ups respond with right value --- src/map/pc.c | 49 +++++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 26 deletions(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index e2f8eec..5bb0009 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4610,52 +4610,49 @@ int pc_statusup(struct map_session_data *sd,int type) nullpo_retr(0, sd); + switch(type){ + case SP_STR: + val= sd->status.str; + break; + case SP_AGI: + val= sd->status.agi; + break; + case SP_VIT: + val= sd->status.vit; + break; + case SP_INT: + val= sd->status.int_; + break; + case SP_DEX: + val= sd->status.dex; + break; + case SP_LUK: + val= sd->status.luk; + break; + } + need=pc_need_status_point(sd,type); - if(typeSP_LUK || need<0 || need>sd->status.status_point){ - clif_statusupack(sd,type,0,0); + if(typeSP_LUK || need<0 || need>sd->status.status_point || val >= battle_config.max_parameter){ + clif_statusupack(sd,type,0,val); return 1; } switch(type){ case SP_STR: - if(sd->status.str >= battle_config.max_parameter) { - clif_statusupack(sd,type,0,0); - return 1; - } val= ++sd->status.str; break; case SP_AGI: - if(sd->status.agi >= battle_config.max_parameter) { - clif_statusupack(sd,type,0,0); - return 1; - } val= ++sd->status.agi; break; case SP_VIT: - if(sd->status.vit >= battle_config.max_parameter) { - clif_statusupack(sd,type,0,0); - return 1; - } val= ++sd->status.vit; break; case SP_INT: - if(sd->status.int_ >= battle_config.max_parameter) { - clif_statusupack(sd,type,0,0); - return 1; - } val= ++sd->status.int_; break; case SP_DEX: - if(sd->status.dex >= battle_config.max_parameter) { - clif_statusupack(sd,type,0,0); - return 1; - } val= ++sd->status.dex; break; case SP_LUK: - if(sd->status.luk >= battle_config.max_parameter) { - clif_statusupack(sd,type,0,0); - return 1; - } val= ++sd->status.luk; break; } -- cgit v1.2.3-60-g2f50