diff options
author | Dastgir <dastgirpojee@rocketmail.com> | 2015-12-17 16:10:19 +0530 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-01-05 13:09:15 +0100 |
commit | 0c458a4976ea392a71ccfa8d86f2ebf86d03e1b4 (patch) | |
tree | bb90a52d78795f17f6268f815a77f66d77044b8f /src/map/clif.c | |
parent | 987b90508e7e6528eca2983416ac96cc1452ed61 (diff) | |
download | hercules-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/clif.c')
-rw-r--r-- | src/map/clif.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index a26fece79..053017a4a 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1059,7 +1059,7 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu } #endif #if PACKETVER >= 20150513 - p.body = 0; + p.body = vd->body_style; #endif clif->send(&p,sizeof(p),tsd?&tsd->bl:bl,target); @@ -1198,7 +1198,7 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) { } #endif #if PACKETVER >= 20150513 - p.body = 0; + p.body = vd->body_style; #endif if( disguised(bl) ) { nullpo_retv(sd); @@ -1288,7 +1288,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd, } #endif #if PACKETVER >= 20150513 - p.body = 0; + p.body = vd->body_style; #endif clif->send(&p,sizeof(p),tsd?&tsd->bl:bl,target); @@ -1417,6 +1417,8 @@ bool clif_spawn(struct block_list *bl) if (vd->cloth_color) clif->refreshlook(bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,AREA_WOS); + if (vd->body_style) + clif->refreshlook(bl,bl->id,LOOK_BODY2,vd->body_style,AREA_WOS); switch (bl->type) { case BL_PC: @@ -1681,6 +1683,8 @@ void clif_move2(struct block_list *bl, struct view_data *vd, struct unit_data *u if(vd->cloth_color) clif->refreshlook(bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,AREA_WOS); + if (vd->body_style) + clif->refreshlook(bl,bl->id,LOOK_BODY2,vd->body_style,AREA_WOS); switch(bl->type) { case BL_PC: @@ -3120,6 +3124,11 @@ void clif_changelook(struct block_list *bl,int type,int val) vd->cloth_color = 0; if (sd->sc.option&OPTION_OKTOBERFEST /* TODO: config? */) vd->cloth_color = 0; + if (vd->body_style && ( + sd->sc.option&OPTION_WEDDING || sd->sc.option&OPTION_XMAS || + sd->sc.option&OPTION_SUMMER || sd->sc.option&OPTION_HANBOK || + sd->sc.option&OPTION_OKTOBERFEST)) + vd->body_style = 0; break; case LOOK_HAIR: vd->hair_style = val; @@ -3177,6 +3186,14 @@ void clif_changelook(struct block_list *bl,int type,int val) vd->robe = val; #endif break; + case LOOK_BODY2: + if (val && ( + sd->sc.option&OPTION_WEDDING || sd->sc.option&OPTION_XMAS || + sd->sc.option&OPTION_SUMMER || sd->sc.option&OPTION_HANBOK || + sd->sc.option&OPTION_OKTOBERFEST)) + val = 0; + vd->body_style = val; + break; } // prevent leaking the presence of GM-hidden objects @@ -4160,6 +4177,9 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl) { if (vd->cloth_color) clif->refreshlook(&sd->bl,bl->id,LOOK_CLOTHES_COLOR,vd->cloth_color,SELF); + if (vd->body_style) + clif->refreshlook(&sd->bl,bl->id,LOOK_BODY2,vd->body_style,SELF); + switch (bl->type) { case BL_PC: { @@ -8281,6 +8301,8 @@ void clif_refresh(struct map_session_data *sd) if (sd->vd.cloth_color) clif->refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF); + if (sd->vd.body_style) + clif->refreshlook(&sd->bl,sd->bl.id,LOOK_BODY2,sd->vd.body_style,SELF); if(homun_alive(sd->hd)) clif->send_homdata(sd,SP_ACK,0); if( sd->md ) { @@ -9124,6 +9146,8 @@ void clif_parse_LoadEndAck(int fd, struct map_session_data *sd) { if(sd->vd.cloth_color) clif->refreshlook(&sd->bl,sd->bl.id,LOOK_CLOTHES_COLOR,sd->vd.cloth_color,SELF); + if (sd->vd.body_style) + clif->refreshlook(&sd->bl,sd->bl.id,LOOK_BODY2,sd->vd.body_style,SELF); // item clif->inventorylist(sd); // inventory list first, otherwise deleted items in pc->checkitem show up as 'unknown item' pc->checkitem(sd); |