summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorDastgir <dastgirpojee@rocketmail.com>2015-12-17 16:10:19 +0530
committerHaru <haru@dotalux.com>2016-01-05 13:09:15 +0100
commit0c458a4976ea392a71ccfa8d86f2ebf86d03e1b4 (patch)
treebb90a52d78795f17f6268f815a77f66d77044b8f /src/map/pc.c
parent987b90508e7e6528eca2983416ac96cc1452ed61 (diff)
downloadhercules-0c458a4976ea392a71ccfa8d86f2ebf86d03e1b4.tar.gz
hercules-0c458a4976ea392a71ccfa8d86f2ebf86d03e1b4.tar.bz2
hercules-0c458a4976ea392a71ccfa8d86f2ebf86d03e1b4.tar.xz
hercules-0c458a4976ea392a71ccfa8d86f2ebf86d03e1b4.zip
Added Support for BodyStyle
Closes #974 as merged
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 1045a25be..b6b6787e9 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -596,6 +596,10 @@ int pc_makesavestatus(struct map_session_data *sd)
if(!battle_config.save_clothcolor)
sd->status.clothes_color=0;
+ if (!battle_config.save_body_style)
+ sd->status.body = 0;
+
+
//Only copy the Cart/Peco/Falcon options, the rest are handled via
//status change load/saving. [Skotlex]
#ifdef NEW_CARTS
@@ -1067,6 +1071,9 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
if( sd->status.clothes_color < MIN_CLOTH_COLOR || sd->status.clothes_color > MAX_CLOTH_COLOR ) {
sd->status.clothes_color = MIN_CLOTH_COLOR;
}
+ if (sd->status.body < MIN_BODY_STYLE || sd->status.body > MAX_BODY_STYLE) {
+ sd->status.body = MIN_BODY_STYLE;
+ }
//Initializations to null/0 unneeded since map_session_data was filled with 0 upon allocation.
if(!sd->status.hp) pc_setdead(sd);
@@ -8450,6 +8457,8 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
clif->changelook(&sd->bl,LOOK_BASE,sd->vd.class_); // move sprite update to prevent client crashes with incompatible equipment [Valaris]
if(sd->vd.cloth_color)
clif->changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
+ if (sd->vd.body_style)
+ clif->changelook(&sd->bl,LOOK_BODY2,sd->vd.body_style);
//Update skill tree.
pc->calc_skilltree(sd);
@@ -8546,6 +8555,8 @@ int pc_changelook(struct map_session_data *sd,int type,int val)
clif->changelook(&sd->bl,LOOK_WEAPON,sd->status.weapon);
if (sd->vd.cloth_color)
clif->changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
+ if (sd->vd.body_style)
+ clif->changelook(&sd->bl,LOOK_BODY2,sd->vd.body_style);
clif->skillinfoblock(sd);
return 0;
break;
@@ -8594,6 +8605,10 @@ int pc_changelook(struct map_session_data *sd,int type,int val)
case LOOK_ROBE:
sd->status.robe = val;
break;
+ case LOOK_BODY2:
+ val = cap_value(val, MIN_BODY_STYLE, MAX_BODY_STYLE);
+ sd->status.body=val;
+ break;
}
clif->changelook(&sd->bl,type,val);
return 0;
@@ -8690,6 +8705,8 @@ int pc_setoption(struct map_session_data *sd,int type)
clif->changelook(&sd->bl,LOOK_BASE,new_look);
if (sd->vd.cloth_color)
clif->changelook(&sd->bl,LOOK_CLOTHES_COLOR,sd->vd.cloth_color);
+ if( sd->vd.body_style )
+ clif->changelook(&sd->bl,LOOK_BODY2,sd->vd.body_style);
clif->skillinfoblock(sd); // Skill list needs to be updated after base change.
return 0;