From a9e2cd0b6216ae5dfdd8ae4701bb7a3f401a6bbd Mon Sep 17 00:00:00 2001 From: AnnieRuru Date: Mon, 11 Mar 2019 06:40:30 +0800 Subject: Fix atcommand "@jobchange" when the player changing from 3rd job having alternate body style into non-3rd job, crashing the client --- src/map/pc.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/map') diff --git a/src/map/pc.c b/src/map/pc.c index 83e2affc0..79fa63bcf 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -9008,6 +9008,13 @@ static int pc_jobchange(struct map_session_data *sd, int class, int upper) if (sd->disguise != -1) pc->disguise(sd, -1); + // Fix atcommand @jobchange when the player changing from 3rd job having alternate body style into non-3rd job, crashing the client + if (pc->has_second_costume(sd) == false) { + sd->status.body = 0; + sd->vd.body_style = 0; + clif->changelook(&sd->bl, LOOK_BODY2, sd->vd.body_style); + } + status->set_viewdata(&sd->bl, class); 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) -- cgit v1.2.3-70-g09d2