diff options
author | Hercules.ws <Hercules@efficiently.awesome> | 2013-10-24 09:51:10 +0200 |
---|---|---|
committer | HerculesWSAPI <Hercules@efficiently.awesome> | 2013-10-24 09:51:10 +0200 |
commit | 491892212d338903179909b89a5bfc2385e52261 (patch) | |
tree | c1b1291e2a93af13bf0e24c719faafd1688ba325 | |
parent | 8b07c677e351056b0d23fbc3726f80829ae4d253 (diff) | |
download | hercules-491892212d338903179909b89a5bfc2385e52261.tar.gz hercules-491892212d338903179909b89a5bfc2385e52261.tar.bz2 hercules-491892212d338903179909b89a5bfc2385e52261.tar.xz hercules-491892212d338903179909b89a5bfc2385e52261.zip |
HPM Hooks Update
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
-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 | 26 |
3 files changed, 31 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc index 8da24df17..8d5449b4b 100644 --- a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc @@ -61,6 +61,8 @@ struct { struct HPMHookPoint *HP_atcommand_doload_post; struct HPMHookPoint *HP_atcommand_base_commands_pre; struct HPMHookPoint *HP_atcommand_base_commands_post; + struct HPMHookPoint *HP_atcommand_add_pre; + struct HPMHookPoint *HP_atcommand_add_post; struct HPMHookPoint *HP_battle_init_pre; struct HPMHookPoint *HP_battle_init_post; struct HPMHookPoint *HP_battle_final_pre; @@ -4950,6 +4952,8 @@ struct { int HP_atcommand_doload_post; int HP_atcommand_base_commands_pre; int HP_atcommand_base_commands_post; + int HP_atcommand_add_pre; + int HP_atcommand_add_post; int HP_battle_init_pre; int HP_battle_init_post; int HP_battle_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc index a538da537..4db9e28f2 100644 --- a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc @@ -34,6 +34,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(atcommand->cmd_db_clear_sub, HP_atcommand_cmd_db_clear_sub) }, { HP_POP(atcommand->doload, HP_atcommand_doload) }, { HP_POP(atcommand->base_commands, HP_atcommand_base_commands) }, + { HP_POP(atcommand->add, HP_atcommand_add) }, /* battle */ { HP_POP(battle->init, HP_battle_init) }, { HP_POP(battle->final, HP_battle_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking.Hooks.inc b/src/plugins/HPMHooking/HPMHooking.Hooks.inc index 6a5f1328d..67a3ae731 100644 --- a/src/plugins/HPMHooking/HPMHooking.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking.Hooks.inc @@ -763,6 +763,32 @@ void HP_atcommand_base_commands(void) { } return; } +bool HP_atcommand_add(char *name, AtCommandFunc func) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_atcommand_add_pre ) { + bool (*preHookFunc) (char *name, AtCommandFunc *func); + for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_add_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_atcommand_add_pre[hIndex].func; + retVal___ = preHookFunc(name, &func); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.atcommand.add(name, func); + } + if( HPMHooks.count.HP_atcommand_add_post ) { + bool (*postHookFunc) (bool retVal___, char *name, AtCommandFunc *func); + for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_add_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_atcommand_add_post[hIndex].func; + retVal___ = postHookFunc(retVal___, name, &func); + } + } + return retVal___; +} /* battle */ void HP_battle_init(void) { int hIndex = 0; |