summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-10-24 07:03:53 -0200
committershennetsind <ind@henn.et>2013-10-24 07:03:53 -0200
commit08ce9564bb231f18f7f3f31beafd19624bb514e4 (patch)
treeface6df366c26fc8a97a63898c93bbffb88cf7e8
parente08c05a0f73d6e6ea4fe64a9b91291bc0a002251 (diff)
parent491892212d338903179909b89a5bfc2385e52261 (diff)
downloadhercules-08ce9564bb231f18f7f3f31beafd19624bb514e4.tar.gz
hercules-08ce9564bb231f18f7f3f31beafd19624bb514e4.tar.bz2
hercules-08ce9564bb231f18f7f3f31beafd19624bb514e4.tar.xz
hercules-08ce9564bb231f18f7f3f31beafd19624bb514e4.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
-rw-r--r--src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking.HookingPoints.inc1
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Hooks.inc26
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;