diff options
author | Hercules.ws <Hercules@efficiently.awesome> | 2014-01-12 16:28:42 +0100 |
---|---|---|
committer | HerculesWSAPI <Hercules@efficiently.awesome> | 2014-01-12 16:28:42 +0100 |
commit | f345e3e50558920cf9a8e7fe142e3e6234b2ee32 (patch) | |
tree | 093db86877b629d0ef739e18d8da30583f87ed59 /src | |
parent | 209d15e07d52a52c110b01f4bad0b52080a69550 (diff) | |
download | hercules-f345e3e50558920cf9a8e7fe142e3e6234b2ee32.tar.gz hercules-f345e3e50558920cf9a8e7fe142e3e6234b2ee32.tar.bz2 hercules-f345e3e50558920cf9a8e7fe142e3e6234b2ee32.tar.xz hercules-f345e3e50558920cf9a8e7fe142e3e6234b2ee32.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
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 ) { |