diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-09-03 17:03:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-09-09 02:21:18 +0300 |
commit | ce55087fe7389c785515617c0b4c8628adeace53 (patch) | |
tree | 3eee66af61850164ed27d4c0224855a666c18959 | |
parent | a829088c61f04645794bf829a62aa8e3c06a7aa2 (diff) | |
download | hercules-ce55087fe7389c785515617c0b4c8628adeace53.tar.gz hercules-ce55087fe7389c785515617c0b4c8628adeace53.tar.bz2 hercules-ce55087fe7389c785515617c0b4c8628adeace53.tar.xz hercules-ce55087fe7389c785515617c0b4c8628adeace53.zip |
Update HPM hooks.
4 files changed, 102 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 9968d1d18..c020d3130 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -6508,6 +6508,12 @@ typedef void (*HPMHOOK_pre_skill_validate_additional_fields) (struct config_sett typedef void (*HPMHOOK_post_skill_validate_additional_fields) (struct config_setting_t *conf, struct s_skill_db *sk); typedef bool (*HPMHOOK_pre_skill_validate_skilldb) (struct s_skill_db **skt, const char **source); typedef bool (*HPMHOOK_post_skill_validate_skilldb) (bool retVal___, struct s_skill_db *skt, const char *source); +typedef int (*HPMHOOK_pre_skill_validate_weapontype_sub) (const char **type, bool *on, struct s_skill_db **sk); +typedef int (*HPMHOOK_post_skill_validate_weapontype_sub) (int retVal___, const char *type, bool on, struct s_skill_db *sk); +typedef int (*HPMHOOK_pre_skill_validate_ammotype_sub) (const char **type, bool *on, struct s_skill_db **sk); +typedef int (*HPMHOOK_post_skill_validate_ammotype_sub) (int retVal___, const char *type, bool on, struct s_skill_db *sk); +typedef int (*HPMHOOK_pre_skill_validate_unit_flag_sub) (const char **type, bool *on, struct s_skill_db **sk); +typedef int (*HPMHOOK_post_skill_validate_unit_flag_sub) (int retVal___, const char *type, bool on, struct s_skill_db *sk); typedef bool (*HPMHOOK_pre_skill_read_skilldb) (const char **filename); typedef bool (*HPMHOOK_post_skill_read_skilldb) (bool retVal___, const char *filename); typedef void (*HPMHOOK_pre_skill_config_set_level) (struct config_setting_t **conf, int **arr); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 0845d8cdd..c0b0fa9f6 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -5296,6 +5296,12 @@ struct { struct HPMHookPoint *HP_skill_validate_additional_fields_post; struct HPMHookPoint *HP_skill_validate_skilldb_pre; struct HPMHookPoint *HP_skill_validate_skilldb_post; + struct HPMHookPoint *HP_skill_validate_weapontype_sub_pre; + struct HPMHookPoint *HP_skill_validate_weapontype_sub_post; + struct HPMHookPoint *HP_skill_validate_ammotype_sub_pre; + struct HPMHookPoint *HP_skill_validate_ammotype_sub_post; + struct HPMHookPoint *HP_skill_validate_unit_flag_sub_pre; + struct HPMHookPoint *HP_skill_validate_unit_flag_sub_post; struct HPMHookPoint *HP_skill_read_skilldb_pre; struct HPMHookPoint *HP_skill_read_skilldb_post; struct HPMHookPoint *HP_skill_config_set_level_pre; @@ -11351,6 +11357,12 @@ struct { int HP_skill_validate_additional_fields_post; int HP_skill_validate_skilldb_pre; int HP_skill_validate_skilldb_post; + int HP_skill_validate_weapontype_sub_pre; + int HP_skill_validate_weapontype_sub_post; + int HP_skill_validate_ammotype_sub_pre; + int HP_skill_validate_ammotype_sub_post; + int HP_skill_validate_unit_flag_sub_pre; + int HP_skill_validate_unit_flag_sub_post; int HP_skill_read_skilldb_pre; int HP_skill_read_skilldb_post; int HP_skill_config_set_level_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 30ede196a..9f05884a4 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2712,6 +2712,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(skill->validate_unit_flag, HP_skill_validate_unit_flag) }, { HP_POP(skill->validate_additional_fields, HP_skill_validate_additional_fields) }, { HP_POP(skill->validate_skilldb, HP_skill_validate_skilldb) }, + { HP_POP(skill->validate_weapontype_sub, HP_skill_validate_weapontype_sub) }, + { HP_POP(skill->validate_ammotype_sub, HP_skill_validate_ammotype_sub) }, + { HP_POP(skill->validate_unit_flag_sub, HP_skill_validate_unit_flag_sub) }, { HP_POP(skill->read_skilldb, HP_skill_read_skilldb) }, { HP_POP(skill->config_set_level, HP_skill_config_set_level) }, { HP_POP(skill->level_set_value, HP_skill_level_set_value) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 819c3b28c..b1bc0ce34 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -70906,6 +70906,87 @@ bool HP_skill_validate_skilldb(struct s_skill_db *skt, const char *source) { } return retVal___; } +int HP_skill_validate_weapontype_sub(const char *type, bool on, struct s_skill_db *sk) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_skill_validate_weapontype_sub_pre ) { + int (*preHookFunc) (const char **type, bool *on, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_weapontype_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_weapontype_sub_pre[hIndex].func; + retVal___ = preHookFunc(&type, &on, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.skill.validate_weapontype_sub(type, on, sk); + } + if( HPMHooks.count.HP_skill_validate_weapontype_sub_post ) { + int (*postHookFunc) (int retVal___, const char *type, bool on, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_weapontype_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_weapontype_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, type, on, sk); + } + } + return retVal___; +} +int HP_skill_validate_ammotype_sub(const char *type, bool on, struct s_skill_db *sk) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_skill_validate_ammotype_sub_pre ) { + int (*preHookFunc) (const char **type, bool *on, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_ammotype_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_ammotype_sub_pre[hIndex].func; + retVal___ = preHookFunc(&type, &on, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.skill.validate_ammotype_sub(type, on, sk); + } + if( HPMHooks.count.HP_skill_validate_ammotype_sub_post ) { + int (*postHookFunc) (int retVal___, const char *type, bool on, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_ammotype_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_ammotype_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, type, on, sk); + } + } + return retVal___; +} +int HP_skill_validate_unit_flag_sub(const char *type, bool on, struct s_skill_db *sk) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_skill_validate_unit_flag_sub_pre ) { + int (*preHookFunc) (const char **type, bool *on, struct s_skill_db **sk); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_unit_flag_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_validate_unit_flag_sub_pre[hIndex].func; + retVal___ = preHookFunc(&type, &on, &sk); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.skill.validate_unit_flag_sub(type, on, sk); + } + if( HPMHooks.count.HP_skill_validate_unit_flag_sub_post ) { + int (*postHookFunc) (int retVal___, const char *type, bool on, struct s_skill_db *sk); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_validate_unit_flag_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_validate_unit_flag_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, type, on, sk); + } + } + return retVal___; +} bool HP_skill_read_skilldb(const char *filename) { int hIndex = 0; bool retVal___ = false; |