From 3bda07c3983ad715009717695702ff8e799e54d7 Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Wed, 1 Jan 2014 04:05:58 +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(+) diff --git a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc index 4ae16ed88..804ec86e2 100644 --- a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc @@ -3365,6 +3365,8 @@ struct { struct HPMHookPoint *HP_npc_market_tosql_post; struct HPMHookPoint *HP_npc_market_delfromsql_pre; struct HPMHookPoint *HP_npc_market_delfromsql_post; + struct HPMHookPoint *HP_npc_market_delfromsql_sub_pre; + struct HPMHookPoint *HP_npc_market_delfromsql_sub_post; struct HPMHookPoint *HP_npc_secure_timeout_timer_pre; struct HPMHookPoint *HP_npc_secure_timeout_timer_post; struct HPMHookPoint *HP_party_init_pre; @@ -8358,6 +8360,8 @@ struct { int HP_npc_market_tosql_post; int HP_npc_market_delfromsql_pre; int HP_npc_market_delfromsql_post; + int HP_npc_market_delfromsql_sub_pre; + int HP_npc_market_delfromsql_sub_post; int HP_npc_secure_timeout_timer_pre; int HP_npc_secure_timeout_timer_post; int HP_party_init_pre; diff --git a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc index c016ca418..8188f7c30 100644 --- a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc @@ -1709,6 +1709,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(npc->market_fromsql, HP_npc_market_fromsql) }, { HP_POP(npc->market_tosql, HP_npc_market_tosql) }, { HP_POP(npc->market_delfromsql, HP_npc_market_delfromsql) }, + { HP_POP(npc->market_delfromsql_sub, HP_npc_market_delfromsql_sub) }, { HP_POP(npc->secure_timeout_timer, HP_npc_secure_timeout_timer) }, /* party */ { HP_POP(party->init, HP_party_init) }, diff --git a/src/plugins/HPMHooking/HPMHooking.Hooks.inc b/src/plugins/HPMHooking/HPMHooking.Hooks.inc index 715c88095..e5aa3bd4a 100644 --- a/src/plugins/HPMHooking/HPMHooking.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking.Hooks.inc @@ -43314,6 +43314,31 @@ void HP_npc_market_delfromsql(struct npc_data *nd, unsigned short index) { } return; } +void HP_npc_market_delfromsql_sub(const char *npcname, unsigned short index) { + int hIndex = 0; + if( HPMHooks.count.HP_npc_market_delfromsql_sub_pre ) { + void (*preHookFunc) (const char *npcname, unsigned short *index); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_npc_market_delfromsql_sub_pre[hIndex].func; + preHookFunc(npcname, &index); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.npc.market_delfromsql_sub(npcname, index); + } + if( HPMHooks.count.HP_npc_market_delfromsql_sub_post ) { + void (*postHookFunc) (const char *npcname, unsigned short *index); + for(hIndex = 0; hIndex < HPMHooks.count.HP_npc_market_delfromsql_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_npc_market_delfromsql_sub_post[hIndex].func; + postHookFunc(npcname, &index); + } + } + return; +} int HP_npc_secure_timeout_timer(int tid, int64 tick, int id, intptr_t data) { int hIndex = 0; int retVal___ = 0; -- cgit v1.2.3-70-g09d2