From d5cbfe3188c9c0f91f74772237606863c5ff6114 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 9 Jan 2015 14:02:48 +0300 Subject: Update HPM hooks. --- .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 4 ++++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 1 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 27 ++++++++++++++++++++++ 3 files changed, 32 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 9090af876..06a046812 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -3949,6 +3949,8 @@ struct { struct HPMHookPoint *HP_pc_global_expiration_timer_post; struct HPMHookPoint *HP_pc_expire_check_pre; struct HPMHookPoint *HP_pc_expire_check_post; + struct HPMHookPoint *HP_pc_db_checkid_pre; + struct HPMHookPoint *HP_pc_db_checkid_post; struct HPMHookPoint *HP_pc_autotrade_load_pre; struct HPMHookPoint *HP_pc_autotrade_load_post; struct HPMHookPoint *HP_pc_autotrade_update_pre; @@ -9106,6 +9108,8 @@ struct { int HP_pc_global_expiration_timer_post; int HP_pc_expire_check_pre; int HP_pc_expire_check_post; + int HP_pc_db_checkid_pre; + int HP_pc_db_checkid_post; int HP_pc_autotrade_load_pre; int HP_pc_autotrade_load_post; int HP_pc_autotrade_update_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index d83b398eb..7c09737fa 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2005,6 +2005,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->expiration_timer, HP_pc_expiration_timer) }, { HP_POP(pc->global_expiration_timer, HP_pc_global_expiration_timer) }, { HP_POP(pc->expire_check, HP_pc_expire_check) }, + { HP_POP(pc->db_checkid, HP_pc_db_checkid) }, { HP_POP(pc->autotrade_load, HP_pc_autotrade_load) }, { HP_POP(pc->autotrade_update, HP_pc_autotrade_update) }, { HP_POP(pc->autotrade_start, HP_pc_autotrade_start) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 3249949e7..9efaa6718 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -52854,6 +52854,33 @@ void HP_pc_expire_check(struct map_session_data *sd) { } return; } +bool HP_pc_db_checkid(unsigned int class_) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_pc_db_checkid_pre ) { + bool (*preHookFunc) (unsigned int *class_); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_db_checkid_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pc_db_checkid_pre[hIndex].func; + retVal___ = preHookFunc(&class_); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.db_checkid(class_); + } + if( HPMHooks.count.HP_pc_db_checkid_post ) { + bool (*postHookFunc) (bool retVal___, unsigned int *class_); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_db_checkid_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pc_db_checkid_post[hIndex].func; + retVal___ = postHookFunc(retVal___, &class_); + } + } + return retVal___; +} void HP_pc_autotrade_load(void) { int hIndex = 0; if( HPMHooks.count.HP_pc_autotrade_load_pre ) { -- cgit v1.2.3-70-g09d2