From 1d12bb1704115e299dbcc0d2a05cd9f2c68f91fd Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Mon, 10 Mar 2014 02:29:21 +0100 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc | 4 ++++ .../HPMHooking/HPMHooking.HookingPoints.inc | 1 + src/plugins/HPMHooking/HPMHooking.Hooks.inc | 25 ++++++++++++++++++++++ 3 files changed, 30 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc index fa9b04d39..4f37743f6 100644 --- a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc @@ -4081,6 +4081,8 @@ struct { struct HPMHookPoint *HP_script_alloc_state_post; struct HPMHookPoint *HP_script_free_state_pre; struct HPMHookPoint *HP_script_free_state_post; + struct HPMHookPoint *HP_script_add_pending_ref_pre; + struct HPMHookPoint *HP_script_add_pending_ref_post; struct HPMHookPoint *HP_script_run_autobonus_pre; struct HPMHookPoint *HP_script_run_autobonus_post; struct HPMHookPoint *HP_script_cleararray_pc_pre; @@ -9112,6 +9114,8 @@ struct { int HP_script_alloc_state_post; int HP_script_free_state_pre; int HP_script_free_state_post; + int HP_script_add_pending_ref_pre; + int HP_script_add_pending_ref_post; int HP_script_run_autobonus_pre; int HP_script_run_autobonus_post; int HP_script_cleararray_pc_pre; diff --git a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc index b90bb6a88..dd8c603d3 100644 --- a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc @@ -2074,6 +2074,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->free_vars, HP_script_free_vars) }, { HP_POP(script->alloc_state, HP_script_alloc_state) }, { HP_POP(script->free_state, HP_script_free_state) }, + { HP_POP(script->add_pending_ref, HP_script_add_pending_ref) }, { HP_POP(script->run_autobonus, HP_script_run_autobonus) }, { HP_POP(script->cleararray_pc, HP_script_cleararray_pc) }, { HP_POP(script->setarray_pc, HP_script_setarray_pc) }, diff --git a/src/plugins/HPMHooking/HPMHooking.Hooks.inc b/src/plugins/HPMHooking/HPMHooking.Hooks.inc index 49d276edb..78987f81a 100644 --- a/src/plugins/HPMHooking/HPMHooking.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking.Hooks.inc @@ -52614,6 +52614,31 @@ void HP_script_free_state(struct script_state *st) { } return; } +void HP_script_add_pending_ref(struct script_state *st, struct reg_db *ref) { + int hIndex = 0; + if( HPMHooks.count.HP_script_add_pending_ref_pre ) { + void (*preHookFunc) (struct script_state *st, struct reg_db *ref); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_pending_ref_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_script_add_pending_ref_pre[hIndex].func; + preHookFunc(st, ref); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.script.add_pending_ref(st, ref); + } + if( HPMHooks.count.HP_script_add_pending_ref_post ) { + void (*postHookFunc) (struct script_state *st, struct reg_db *ref); + for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_pending_ref_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_script_add_pending_ref_post[hIndex].func; + postHookFunc(st, ref); + } + } + return; +} void HP_script_run_autobonus(const char *autobonus, int id, int pos) { int hIndex = 0; if( HPMHooks.count.HP_script_run_autobonus_pre ) { -- cgit v1.2.3-60-g2f50