From b9ac7fb56c7b76042b13d0e97c652c3fb28916c7 Mon Sep 17 00:00:00 2001 From: Lorenzo Buitizon Date: Sat, 30 Aug 2025 19:32:06 +0800 Subject: [PATCH] Fixed issue regarding stylist ui behavior and restrictions. Signed-off-by: Lorenzo Buitizon --- src/map/clif.c | 15 +++++++++++++-- src/map/pc.h | 16 +++++++++------- src/map/unit.c | 1 + 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index 605346866dc..7fc132bd30a 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -24032,11 +24032,16 @@ static void clif_open_ui_send1(struct map_session_data *sd, enum zc_ui_types ui_ switch (ui_type) { case ZC_BANK_UI: - case ZC_STYLIST_UI: case ZC_CAPTCHA_UI: case ZC_MACRO_UI: #if PACKETVER >= 20171122 p.data = data; +#endif + break; + case ZC_STYLIST_UI: + sd->state.stylist_ui = 1; +#if PACKETVER >= 20171122 + p.data = data; #endif break; #if PACKETVER >= 20171122 @@ -24351,6 +24356,9 @@ static void clif_parse_cz_req_style_change(int fd, struct map_session_data *sd) if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) return; + if (sd->state.stylist_ui == 0) + return; + const struct PACKET_CZ_REQ_STYLE_CHANGE *p = RP2PTR(fd); if (p->HeadStyle > 0) @@ -24375,6 +24383,9 @@ static void clif_parse_cz_req_style_change2(int fd, struct map_session_data *sd) if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) return; + if (sd->state.stylist_ui == 0) + return; + const struct PACKET_CZ_REQ_STYLE_CHANGE2 *p = RP2PTR(fd); if (p->HeadStyle > 0) @@ -24401,7 +24412,7 @@ static void clif_parse_cz_req_style_change2(int fd, struct map_session_data *sd) static void clif_parse_cz_style_close(int fd, struct map_session_data *sd) __attribute__((nonnull(2))); static void clif_parse_cz_style_close(int fd, struct map_session_data *sd) { - // do nothing + sd->state.stylist_ui = 0; } static void clif_style_change_response(struct map_session_data *sd, enum stylist_shop flag) diff --git a/src/map/pc.h b/src/map/pc.h index 657dbf47aa0..df9b52a33e9 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -269,6 +269,7 @@ struct map_session_data { unsigned int grade_ui : 1; unsigned int reform_ui : 1; unsigned int enchant_ui : 1; + unsigned int stylist_ui : 1; } state; struct { unsigned char no_weapon_damage, no_magic_damage, no_misc_damage; @@ -720,13 +721,14 @@ END_ZEROED_BLOCK; #define pc_isidle(sd) ( (sd)->chat_id != 0 || (sd)->state.vending || (sd)->state.buyingstore || DIFF_TICK(sockt->last_tick, (sd)->idletime) >= battle->bc->idle_no_share ) #define pc_istrading(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->state.trading ) #define pc_istrading_except_npc(sd) ( (sd)->state.vending != 0 || (sd)->state.buyingstore != 0 || (sd)->state.trading != 0 ) -#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1 || (sd)->state.grade_ui == 1 || (sd)->state.reform_ui == 1 || (sd)->state.enchant_ui == 1) -#define pc_cant_act_except_lapine(sd) ((sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.grade_ui == 1 || (sd)->state.reform_ui == 1 || (sd)->state.enchant_ui == 1) -#define pc_cant_act_except_npc(sd) ( (sd)->state.vending != 0 || (sd)->state.buyingstore != 0 || (sd)->chat_id != 0 || ((sd)->sc.opt1 != 0 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading != 0 || (sd)->state.storage_flag != 0 || (sd)->state.prevend != 0 || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1 || (sd)->state.grade_ui == 1 || (sd)->state.reform_ui == 1 || (sd)->state.enchant_ui == 1) -#define pc_cant_act_except_npc_chat(sd) ( (sd)->state.vending != 0 || (sd)->state.buyingstore != 0 || ((sd)->sc.opt1 != 0 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading != 0 || (sd)->state.storage_flag != 0 || (sd)->state.prevend != 0 || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1 || (sd)->state.grade_ui == 1 || (sd)->state.reform_ui == 1 || (sd)->state.enchant_ui == 1) -#define pc_cant_act_except_grade(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1 || (sd)->state.reform_ui == 1 || (sd)->state.enchant_ui == 1) -#define pc_cant_act_except_reform(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1 || (sd)->state.grade_ui == 1 || (sd)->state.enchant_ui == 1) -#define pc_cant_act_except_enchant(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1 || (sd)->state.grade_ui == 1 || (sd)->state.reform_ui == 1) +#define pc_cant_act(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1 || (sd)->state.grade_ui == 1 || (sd)->state.reform_ui == 1 || (sd)->state.enchant_ui == 1 || (sd)->state.stylist_ui == 1) +#define pc_cant_act_except_lapine(sd) ((sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.grade_ui == 1 || (sd)->state.reform_ui == 1 || (sd)->state.enchant_ui == 1 || (sd)->state.stylist_ui == 1) +#define pc_cant_act_except_npc(sd) ( (sd)->state.vending != 0 || (sd)->state.buyingstore != 0 || (sd)->chat_id != 0 || ((sd)->sc.opt1 != 0 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading != 0 || (sd)->state.storage_flag != 0 || (sd)->state.prevend != 0 || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1 || (sd)->state.grade_ui == 1 || (sd)->state.reform_ui == 1 || (sd)->state.enchant_ui == 1 || (sd)->state.stylist_ui == 1) +#define pc_cant_act_except_npc_chat(sd) ( (sd)->state.vending != 0 || (sd)->state.buyingstore != 0 || ((sd)->sc.opt1 != 0 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading != 0 || (sd)->state.storage_flag != 0 || (sd)->state.prevend != 0 || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1 || (sd)->state.grade_ui == 1 || (sd)->state.reform_ui == 1 || (sd)->state.enchant_ui == 1 || (sd)->state.stylist_ui == 1) +#define pc_cant_act_except_grade(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1 || (sd)->state.reform_ui == 1 || (sd)->state.enchant_ui == 1 || (sd)->state.stylist_ui == 1) +#define pc_cant_act_except_reform(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1 || (sd)->state.grade_ui == 1 || (sd)->state.enchant_ui == 1 || (sd)->state.stylist_ui == 1) +#define pc_cant_act_except_enchant(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1 || (sd)->state.grade_ui == 1 || (sd)->state.reform_ui == 1 || (sd)->state.stylist_ui == 1) +#define pc_cant_act_except_stylist(sd) ( (sd)->npc_id || (sd)->state.vending || (sd)->state.buyingstore || (sd)->chat_id != 0 || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1 || (sd)->state.grade_ui == 1 || (sd)->state.reform_ui == 1 || (sd)->state.enchant_ui == 1) /* equals pc_cant_act except it doesn't check for chat rooms */ #define pc_cant_act2(sd) ( (sd)->npc_id || (sd)->state.buyingstore || ((sd)->sc.opt1 && (sd)->sc.opt1 != OPT1_BURNING) || (sd)->state.trading || (sd)->state.storage_flag || (sd)->state.prevend || (sd)->state.refine_ui == 1 || (sd)->state.lapine_ui == 1) diff --git a/src/map/unit.c b/src/map/unit.c index bde6c43de4e..f45ec16f6da 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1248,6 +1248,7 @@ static int unit_can_move(struct block_list *bl) sd->state.vending || sd->state.prevend || sd->state.buyingstore || + sd->state.stylist_ui || sd->block_action.move )) return 0; //Can't move