From 7751fc21990d18f215dff82669a470b7c3660b11 Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 13 Feb 2006 16:54:24 +0000 Subject: - Modified PA_GOSPEL so that the random damage attack becomes a BF_MISC attack. - Added pc_resetskill when lowering job level and there's not enough skpoints to substract. - Fixed compile error of SG_FUSION in pc.c - Modified pc_resetskill to receive a flag to indicate if it should or not do status_calc_pc and send skill block updates. Meant to optimize performance when used in the middle of a larger update. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5269 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/pc.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index 9e8467c33..1800c74ea 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5065,13 +5065,8 @@ int pc_resetlvl(struct map_session_data* sd,int type) nullpo_retr(0, sd); - if (type != 3) { - for(i=1;istatus.skill[i].lv && - !skill_get_inf2(i)&INF2_WEDDING_SKILL) //Do not reset Wedding Skills. [Skotlex] - sd->status.skill[i].lv = 0; - } - } + if (type != 3) //Also reset skills + pc_resetskill(sd, 0); if(type == 1){ sd->status.skill_point=0; @@ -5142,8 +5137,8 @@ int pc_resetlvl(struct map_session_data* sd,int type) //Send map-change packet to do a level range check and break party settings. [Skotlex] party_send_movemap(sd); } - clif_skillinfoblock(sd); status_calc_pc(sd,0); + clif_skillinfoblock(sd); return 0; } @@ -5205,9 +5200,10 @@ int pc_resetstate(struct map_session_data* sd) /*========================================== * /resetskill + * if flag is 1, perform block resync and status_calc call. *------------------------------------------ */ -int pc_resetskill(struct map_session_data* sd) +int pc_resetskill(struct map_session_data* sd, int flag) { int i, skill, inf2; nullpo_retr(0, sd); @@ -5236,9 +5232,11 @@ int pc_resetskill(struct map_session_data* sd) sd->status.skill[i].lv = 0; } } - clif_updatestatus(sd,SP_SKILLPOINT); - clif_skillinfoblock(sd); - status_calc_pc(sd,0); + if (flag) { + clif_updatestatus(sd,SP_SKILLPOINT); + clif_skillinfoblock(sd); + status_calc_pc(sd,0); + } return 0; } -- cgit v1.2.3-70-g09d2