Skip to content

Commit

Permalink
HPM Hooks Update
Browse files Browse the repository at this point in the history
Signed-off-by: HerculesWSAPI <dev@herc.ws>
  • Loading branch information
HerculesWSAPI committed Apr 7, 2019
1 parent f71e3a5 commit 6ea3d0f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/HPMHooking/HPMHooking.Defs.inc
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
Expand Up @@ -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) },
Expand Down
26 changes: 26 additions & 0 deletions src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
Expand Up @@ -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) {
Expand Down

0 comments on commit 6ea3d0f

Please sign in to comment.