diff options
Diffstat (limited to 'src/plugins')
4 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 3ec573b6f..5eb8ac24c 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -3510,6 +3510,8 @@ typedef bool (*HPMHOOK_pre_itemdb_is_item_usable) (struct item_data **item); typedef bool (*HPMHOOK_post_itemdb_is_item_usable) (bool retVal___, struct item_data *item); typedef bool (*HPMHOOK_pre_itemdb_lookup_const) (const struct config_setting_t **it, const char **name, int **value); typedef bool (*HPMHOOK_post_itemdb_lookup_const) (bool retVal___, const struct config_setting_t *it, const char *name, int *value); +typedef bool (*HPMHOOK_pre_itemdb_lookup_const_mask) (const struct config_setting_t **it, const char **name, int **value); +typedef bool (*HPMHOOK_post_itemdb_lookup_const_mask) (bool retVal___, const struct config_setting_t *it, const char *name, int *value); #endif // MAP_ITEMDB_H #ifdef LOGIN_LCLIF_H /* lclif */ typedef void (*HPMHOOK_pre_lclif_init) (void); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index b7b161b6b..e2494067c 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -2874,6 +2874,8 @@ struct { struct HPMHookPoint *HP_itemdb_is_item_usable_post; struct HPMHookPoint *HP_itemdb_lookup_const_pre; struct HPMHookPoint *HP_itemdb_lookup_const_post; + struct HPMHookPoint *HP_itemdb_lookup_const_mask_pre; + struct HPMHookPoint *HP_itemdb_lookup_const_mask_post; struct HPMHookPoint *HP_libconfig_read_pre; struct HPMHookPoint *HP_libconfig_read_post; struct HPMHookPoint *HP_libconfig_write_pre; @@ -9069,6 +9071,8 @@ struct { int HP_itemdb_is_item_usable_post; int HP_itemdb_lookup_const_pre; int HP_itemdb_lookup_const_post; + int HP_itemdb_lookup_const_mask_pre; + int HP_itemdb_lookup_const_mask_post; int HP_libconfig_read_pre; int HP_libconfig_read_post; int HP_libconfig_write_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 37a3efb19..b094fa841 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1474,6 +1474,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(itemdb->id2combo, HP_itemdb_id2combo) }, { HP_POP(itemdb->is_item_usable, HP_itemdb_is_item_usable) }, { HP_POP(itemdb->lookup_const, HP_itemdb_lookup_const) }, + { HP_POP(itemdb->lookup_const_mask, HP_itemdb_lookup_const_mask) }, /* libconfig_interface */ { HP_POP(libconfig->read, HP_libconfig_read) }, { HP_POP(libconfig->write, HP_libconfig_write) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index d16268841..f8e94ea65 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -37811,6 +37811,33 @@ bool HP_itemdb_lookup_const(const struct config_setting_t *it, const char *name, } return retVal___; } +bool HP_itemdb_lookup_const_mask(const struct config_setting_t *it, const char *name, int *value) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_itemdb_lookup_const_mask_pre > 0) { + bool (*preHookFunc) (const struct config_setting_t **it, const char **name, int **value); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_lookup_const_mask_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_itemdb_lookup_const_mask_pre[hIndex].func; + retVal___ = preHookFunc(&it, &name, &value); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.itemdb.lookup_const_mask(it, name, value); + } + if (HPMHooks.count.HP_itemdb_lookup_const_mask_post > 0) { + bool (*postHookFunc) (bool retVal___, const struct config_setting_t *it, const char *name, int *value); + for (hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_lookup_const_mask_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_itemdb_lookup_const_mask_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, name, value); + } + } + return retVal___; +} /* libconfig_interface */ int HP_libconfig_read(struct config_t *config, FILE *stream) { int hIndex = 0; |