diff options
author | Hercules.ws <dev@herc.ws> | 2019-04-07 23:19:09 +0200 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2019-04-07 23:19:09 +0200 |
commit | 6ea3d0fe87019bd7a9f235827f261b21cd87715e (patch) | |
tree | aa1ab63230ef45d07d0c22ea3b08a1cc03974ce0 | |
parent | f71e3a54b7c72057a097756613c9e1804bce479b (diff) | |
download | hercules-6ea3d0fe87019bd7a9f235827f261b21cd87715e.tar.gz hercules-6ea3d0fe87019bd7a9f235827f261b21cd87715e.tar.bz2 hercules-6ea3d0fe87019bd7a9f235827f261b21cd87715e.tar.xz hercules-6ea3d0fe87019bd7a9f235827f261b21cd87715e.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
4 files changed, 33 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index f3b4370fb..26bc9a642 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -2624,6 +2624,8 @@ typedef void (*HPMHOOK_pre_clif_pReqStyleChange) (int *fd, struct map_session_da typedef void (*HPMHOOK_post_clif_pReqStyleChange) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_pReqStyleChange2) (int *fd, struct map_session_data **sd); typedef void (*HPMHOOK_post_clif_pReqStyleChange2) (int fd, struct map_session_data *sd); +typedef void (*HPMHOOK_pre_clif_pStyleClose) (int *fd, struct map_session_data **sd); +typedef void (*HPMHOOK_post_clif_pStyleClose) (int fd, struct map_session_data *sd); typedef void (*HPMHOOK_pre_clif_style_change_response) (struct map_session_data **sd, enum stylist_shop *flag); typedef void (*HPMHOOK_post_clif_style_change_response) (struct map_session_data *sd, enum stylist_shop flag); typedef void (*HPMHOOK_pre_clif_pPetEvolution) (int *fd, struct map_session_data **sd); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 99d6be230..5648dd267 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -2214,6 +2214,8 @@ struct { struct HPMHookPoint *HP_clif_pReqStyleChange_post; struct HPMHookPoint *HP_clif_pReqStyleChange2_pre; struct HPMHookPoint *HP_clif_pReqStyleChange2_post; + struct HPMHookPoint *HP_clif_pStyleClose_pre; + struct HPMHookPoint *HP_clif_pStyleClose_post; struct HPMHookPoint *HP_clif_style_change_response_pre; struct HPMHookPoint *HP_clif_style_change_response_post; struct HPMHookPoint *HP_clif_pPetEvolution_pre; @@ -8899,6 +8901,8 @@ struct { int HP_clif_pReqStyleChange_post; int HP_clif_pReqStyleChange2_pre; int HP_clif_pReqStyleChange2_post; + int HP_clif_pStyleClose_pre; + int HP_clif_pStyleClose_post; int HP_clif_style_change_response_pre; int HP_clif_style_change_response_post; int HP_clif_pPetEvolution_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 8532f9d22..6ab056dfd 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1131,6 +1131,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(clif->PrivateAirshipResponse, HP_clif_PrivateAirshipResponse) }, { HP_POP(clif->pReqStyleChange, HP_clif_pReqStyleChange) }, { HP_POP(clif->pReqStyleChange2, HP_clif_pReqStyleChange2) }, + { HP_POP(clif->pStyleClose, HP_clif_pStyleClose) }, { HP_POP(clif->style_change_response, HP_clif_style_change_response) }, { HP_POP(clif->pPetEvolution, HP_clif_pPetEvolution) }, { HP_POP(clif->petEvolutionResult, HP_clif_petEvolutionResult) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index e6f8a69f0..f5d45658e 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -28858,6 +28858,32 @@ void HP_clif_pReqStyleChange2(int fd, struct map_session_data *sd) { } return; } +void HP_clif_pStyleClose(int fd, struct map_session_data *sd) { + int hIndex = 0; + if (HPMHooks.count.HP_clif_pStyleClose_pre > 0) { + void (*preHookFunc) (int *fd, struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pStyleClose_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_clif_pStyleClose_pre[hIndex].func; + preHookFunc(&fd, &sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.clif.pStyleClose(fd, sd); + } + if (HPMHooks.count.HP_clif_pStyleClose_post > 0) { + void (*postHookFunc) (int fd, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_pStyleClose_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_clif_pStyleClose_post[hIndex].func; + postHookFunc(fd, sd); + } + } + return; +} void HP_clif_style_change_response(struct map_session_data *sd, enum stylist_shop flag) { int hIndex = 0; if (HPMHooks.count.HP_clif_style_change_response_pre > 0) { |