From f2d7f16d0e4162afa2dd32d1bab4e76550d8ca59 Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Mon, 6 Jul 2020 13:51:16 +0200 Subject: Update SQL query in char_change_sex_sub() to update character's gender and robe view ID, too --- src/char/char.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/char/char.c b/src/char/char.c index c61b6107a..04a72fb6b 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -2566,9 +2566,15 @@ static void char_change_sex_sub(int sex, int acc, int char_id, int class, int gu if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `equip`='0' WHERE `char_id`='%d'", inventory_db, char_id)) Sql_ShowDebug(inter->sql_handle); +#if PACKETVER >= 20141016 + char gender = (sex == SEX_MALE) ? 'M' : ((sex == SEX_FEMALE) ? 'F' : 'U'); +#else + char gender = 'U'; +#endif + if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `class`='%d', `weapon`='0', `shield`='0', " - "`head_top`='0', `head_mid`='0', `head_bottom`='0' WHERE `char_id`='%d'", - char_db, class, char_id)) + "`head_top`='0', `head_mid`='0', `head_bottom`='0', `robe`='0', `sex`='%c' " + "WHERE `char_id`='%d' ", char_db, class, gender, char_id)) Sql_ShowDebug(inter->sql_handle); if (guild_id) // If there is a guild, update the guild_member data [Skotlex] inter_guild->sex_changed(guild_id, acc, char_id, sex); -- cgit v1.2.3-70-g09d2