diff options
author | Hercules.ws <dev@herc.ws> | 2020-01-12 18:06:38 +0100 |
---|---|---|
committer | HerculesWSAPI <dev@herc.ws> | 2020-01-12 18:06:38 +0100 |
commit | a47f90111ce72726995b8f4ac4e4d52af839c1f1 (patch) | |
tree | 1fadde56118b4ff57087cda8f92f577776a5f5bb /src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | |
parent | 45b8982191160dc5f5ffc28e0eb8b28c6b8a138b (diff) | |
download | hercules-a47f90111ce72726995b8f4ac4e4d52af839c1f1.tar.gz hercules-a47f90111ce72726995b8f4ac4e4d52af839c1f1.tar.bz2 hercules-a47f90111ce72726995b8f4ac4e4d52af839c1f1.tar.xz hercules-a47f90111ce72726995b8f4ac4e4d52af839c1f1.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
Diffstat (limited to 'src/plugins/HPMHooking/HPMHooking_map.Hooks.inc')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index bdae21c21..7873e544a 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -66643,15 +66643,15 @@ int HP_pc_have_magnifier(struct map_session_data *sd) { } return retVal___; } -int HP_pc_have_item_chain(struct map_session_data *sd, unsigned short chain_id) { +int HP_pc_have_item_chain(struct map_session_data *sd, enum e_chain_cache chain_cache_id) { int hIndex = 0; int retVal___ = 0; if (HPMHooks.count.HP_pc_have_item_chain_pre > 0) { - int (*preHookFunc) (struct map_session_data **sd, unsigned short *chain_id); + int (*preHookFunc) (struct map_session_data **sd, enum e_chain_cache *chain_cache_id); *HPMforce_return = false; for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_item_chain_pre; hIndex++) { preHookFunc = HPMHooks.list.HP_pc_have_item_chain_pre[hIndex].func; - retVal___ = preHookFunc(&sd, &chain_id); + retVal___ = preHookFunc(&sd, &chain_cache_id); } if (*HPMforce_return) { *HPMforce_return = false; @@ -66659,13 +66659,13 @@ int HP_pc_have_item_chain(struct map_session_data *sd, unsigned short chain_id) } } { - retVal___ = HPMHooks.source.pc.have_item_chain(sd, chain_id); + retVal___ = HPMHooks.source.pc.have_item_chain(sd, chain_cache_id); } if (HPMHooks.count.HP_pc_have_item_chain_post > 0) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, unsigned short chain_id); + int (*postHookFunc) (int retVal___, struct map_session_data *sd, enum e_chain_cache chain_cache_id); for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_have_item_chain_post; hIndex++) { postHookFunc = HPMHooks.list.HP_pc_have_item_chain_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, chain_id); + retVal___ = postHookFunc(retVal___, sd, chain_cache_id); } } return retVal___; @@ -66891,6 +66891,33 @@ bool HP_pc_expandInventory(struct map_session_data *sd, int adjustSize) { } return retVal___; } +bool HP_pc_auto_exp_insurance(struct map_session_data *sd) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_pc_auto_exp_insurance_pre > 0) { + bool (*preHookFunc) (struct map_session_data **sd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_auto_exp_insurance_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_pc_auto_exp_insurance_pre[hIndex].func; + retVal___ = preHookFunc(&sd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.auto_exp_insurance(sd); + } + if (HPMHooks.count.HP_pc_auto_exp_insurance_post > 0) { + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_auto_exp_insurance_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_pc_auto_exp_insurance_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd); + } + } + return retVal___; +} /* pcre_interface */ pcre* HP_libpcre_compile(const char *pattern, int options, const char **errptr, int *erroffset, const unsigned char *tableptr) { int hIndex = 0; |