diff options
author | shennetsind <ind@henn.et> | 2014-01-12 15:11:45 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2014-01-12 15:11:45 -0200 |
commit | 34e5c90da462aa589c89646ca7b49376a4282eac (patch) | |
tree | 0565563929dbb9a9a52ea7e1f488b59c17234752 /src | |
parent | 8aeb011694ca3023d93dd6e904b3f42ab93f8ba9 (diff) | |
parent | f345e3e50558920cf9a8e7fe142e3e6234b2ee32 (diff) | |
download | hercules-34e5c90da462aa589c89646ca7b49376a4282eac.tar.gz hercules-34e5c90da462aa589c89646ca7b49376a4282eac.tar.bz2 hercules-34e5c90da462aa589c89646ca7b49376a4282eac.tar.xz hercules-34e5c90da462aa589c89646ca7b49376a4282eac.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src')
-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 ) { |