diff options
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc | 4 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HookingPoints.inc | 1 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Hooks.inc | 25 |
3 files changed, 30 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc index f33e7cf23..77dfef632 100644 --- a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc @@ -4263,6 +4263,8 @@ struct { struct HPMHookPoint *HP_script_array_highest_key_post; struct HPMHookPoint *HP_script_array_free_db_pre; struct HPMHookPoint *HP_script_array_free_db_post; + struct HPMHookPoint *HP_script_array_ensure_zero_pre; + struct HPMHookPoint *HP_script_array_ensure_zero_post; struct HPMHookPoint *HP_script_reg_destroy_single_pre; struct HPMHookPoint *HP_script_reg_destroy_single_post; struct HPMHookPoint *HP_script_reg_destroy_pre; @@ -9288,6 +9290,8 @@ struct { int HP_script_array_highest_key_post; int HP_script_array_free_db_pre; int HP_script_array_free_db_post; + int HP_script_array_ensure_zero_pre; + int HP_script_array_ensure_zero_post; int HP_script_reg_destroy_single_pre; int HP_script_reg_destroy_single_post; int HP_script_reg_destroy_pre; diff --git a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc index d7956c416..c964054e1 100644 --- a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc @@ -2165,6 +2165,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->array_size, HP_script_array_size) }, { HP_POP(script->array_highest_key, HP_script_array_highest_key) }, { HP_POP(script->array_free_db, HP_script_array_free_db) }, + { HP_POP(script->array_ensure_zero, HP_script_array_ensure_zero) }, { HP_POP(script->reg_destroy_single, HP_script_reg_destroy_single) }, { HP_POP(script->reg_destroy, HP_script_reg_destroy) }, { HP_POP(script->generic_ui_array_expand, HP_script_generic_ui_array_expand) }, diff --git a/src/plugins/HPMHooking/HPMHooking.Hooks.inc b/src/plugins/HPMHooking/HPMHooking.Hooks.inc index cca7405e5..9bbb01ade 100644 --- a/src/plugins/HPMHooking/HPMHooking.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking.Hooks.inc @@ -55078,6 +55078,31 @@ int HP_script_array_free_db(DBKey key, DBData *data, va_list ap) { } return retVal___; } +void HP_script_array_ensure_zero(struct script_state *st, struct map_session_data *sd, int64 uid, struct DBMap **ref) { + int hIndex = 0; + if( HPMHooks.count.HP_script_array_ensure_zero_pre ) { + void (*preHookFunc) (struct script_state *st, struct map_session_data *sd, int64 *uid, struct DBMap **ref); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_ensure_zero_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_array_ensure_zero_pre[hIndex].func; + preHookFunc(st, sd, &uid, ref); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.array_ensure_zero(st, sd, uid, ref); + } + if( HPMHooks.count.HP_script_array_ensure_zero_post ) { + void (*postHookFunc) (struct script_state *st, struct map_session_data *sd, int64 *uid, struct DBMap **ref); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_array_ensure_zero_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_array_ensure_zero_post[hIndex].func; + postHookFunc(st, sd, &uid, ref); + } + } + return; +} void HP_script_reg_destroy_single(struct map_session_data *sd, int64 reg, struct script_reg_state *data) { int hIndex = 0; if( HPMHooks.count.HP_script_reg_destroy_single_pre ) { |