summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-04-07 23:18:15 +0200
committerGitHub <noreply@github.com>2019-04-07 23:18:15 +0200
commitf71e3a54b7c72057a097756613c9e1804bce479b (patch)
tree0dcda464d778a2c1d81d99c7816ecfb9fb4d2f0b
parenta48dfbf61dcbc25cb29e276a48665fb720ecc4e9 (diff)
parenta9e2cd0b6216ae5dfdd8ae4701bb7a3f401a6bbd (diff)
downloadhercules-f71e3a54b7c72057a097756613c9e1804bce479b.tar.gz
hercules-f71e3a54b7c72057a097756613c9e1804bce479b.tar.bz2
hercules-f71e3a54b7c72057a097756613c9e1804bce479b.tar.xz
hercules-f71e3a54b7c72057a097756613c9e1804bce479b.zip
Merge pull request #2402 from AnnieRuru/71-bodystyle_crash
Fix @bodystyle crash client
-rw-r--r--src/map/pc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 37c7f1aad..140cf7ac1 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)
@@ -12335,7 +12342,8 @@ static bool pc_has_second_costume(struct map_session_data *sd)
{
nullpo_retr(false, sd);
- if ((sd->job & JOBL_THIRD) != 0)
+// FIXME: JOB_SUPER_NOVICE_E(4190) is not supposed to be 3rd Job. (Issue#2383)
+ if ((sd->job & JOBL_THIRD) != 0 && (sd->job & MAPID_BASEMASK) != MAPID_NOVICE)
return true;
return false;
}