From b67c93a32c30690c546846a2a1ee1d035d7f3e24 Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Fri, 4 Dec 2015 16:48:31 +0100 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 4 ++++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 1 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 26 ++++++++++++++++++++++ 3 files changed, 31 insertions(+) (limited to 'src/plugins/HPMHooking') diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index c74cc8b7f..39543d1a4 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -4263,6 +4263,8 @@ struct { struct HPMHookPoint *HP_pc_autotrade_final_post; struct HPMHookPoint *HP_pc_check_job_name_pre; struct HPMHookPoint *HP_pc_check_job_name_post; + struct HPMHookPoint *HP_pc_update_idle_time_pre; + struct HPMHookPoint *HP_pc_update_idle_time_post; struct HPMHookPoint *HP_pet_init_pre; struct HPMHookPoint *HP_pet_init_post; struct HPMHookPoint *HP_pet_final_pre; @@ -10042,6 +10044,8 @@ struct { int HP_pc_autotrade_final_post; int HP_pc_check_job_name_pre; int HP_pc_check_job_name_post; + int HP_pc_update_idle_time_pre; + int HP_pc_update_idle_time_post; int HP_pet_init_pre; int HP_pet_init_post; int HP_pet_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index a3f7f6b3e..0e8322917 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2172,6 +2172,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->autotrade_populate, HP_pc_autotrade_populate) }, { HP_POP(pc->autotrade_final, HP_pc_autotrade_final) }, { HP_POP(pc->check_job_name, HP_pc_check_job_name) }, + { HP_POP(pc->update_idle_time, HP_pc_update_idle_time) }, /* pet */ { HP_POP(pet->init, HP_pet_init) }, { HP_POP(pet->final, HP_pet_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index fafa4d748..0adf20592 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -57069,6 +57069,32 @@ int HP_pc_check_job_name(const char *name) { } return retVal___; } +void HP_pc_update_idle_time(struct map_session_data *sd, enum e_battle_config_idletime type) { + int hIndex = 0; + if( HPMHooks.count.HP_pc_update_idle_time_pre ) { + void (*preHookFunc) (struct map_session_data *sd, enum e_battle_config_idletime *type); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_update_idle_time_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pc_update_idle_time_pre[hIndex].func; + preHookFunc(sd, &type); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.pc.update_idle_time(sd, type); + } + if( HPMHooks.count.HP_pc_update_idle_time_post ) { + void (*postHookFunc) (struct map_session_data *sd, enum e_battle_config_idletime *type); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_update_idle_time_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pc_update_idle_time_post[hIndex].func; + postHookFunc(sd, &type); + } + } + return; +} /* pet */ int HP_pet_init(bool minimal) { int hIndex = 0; -- cgit v1.2.3-60-g2f50