Skip to content

Commit

Permalink
HPM Hooks Update
Browse files Browse the repository at this point in the history
Signed-off-by: HerculesWSAPI <[email protected]>
  • Loading branch information
HerculesWSAPI committed Mar 10, 2014
1 parent 1a4a16e commit 1d12bb1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4081,6 +4081,8 @@ struct {
struct HPMHookPoint *HP_script_alloc_state_post;
struct HPMHookPoint *HP_script_free_state_pre;
struct HPMHookPoint *HP_script_free_state_post;
struct HPMHookPoint *HP_script_add_pending_ref_pre;
struct HPMHookPoint *HP_script_add_pending_ref_post;
struct HPMHookPoint *HP_script_run_autobonus_pre;
struct HPMHookPoint *HP_script_run_autobonus_post;
struct HPMHookPoint *HP_script_cleararray_pc_pre;
Expand Down Expand Up @@ -9112,6 +9114,8 @@ struct {
int HP_script_alloc_state_post;
int HP_script_free_state_pre;
int HP_script_free_state_post;
int HP_script_add_pending_ref_pre;
int HP_script_add_pending_ref_post;
int HP_script_run_autobonus_pre;
int HP_script_run_autobonus_post;
int HP_script_cleararray_pc_pre;
Expand Down
1 change: 1 addition & 0 deletions src/plugins/HPMHooking/HPMHooking.HookingPoints.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(script->free_vars, HP_script_free_vars) },
{ HP_POP(script->alloc_state, HP_script_alloc_state) },
{ HP_POP(script->free_state, HP_script_free_state) },
{ HP_POP(script->add_pending_ref, HP_script_add_pending_ref) },
{ HP_POP(script->run_autobonus, HP_script_run_autobonus) },
{ HP_POP(script->cleararray_pc, HP_script_cleararray_pc) },
{ HP_POP(script->setarray_pc, HP_script_setarray_pc) },
Expand Down
25 changes: 25 additions & 0 deletions src/plugins/HPMHooking/HPMHooking.Hooks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -52614,6 +52614,31 @@ void HP_script_free_state(struct script_state *st) {
}
return;
}
void HP_script_add_pending_ref(struct script_state *st, struct reg_db *ref) {
int hIndex = 0;
if( HPMHooks.count.HP_script_add_pending_ref_pre ) {
void (*preHookFunc) (struct script_state *st, struct reg_db *ref);
for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_pending_ref_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_script_add_pending_ref_pre[hIndex].func;
preHookFunc(st, ref);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
return;
}
}
{
HPMHooks.source.script.add_pending_ref(st, ref);
}
if( HPMHooks.count.HP_script_add_pending_ref_post ) {
void (*postHookFunc) (struct script_state *st, struct reg_db *ref);
for(hIndex = 0; hIndex < HPMHooks.count.HP_script_add_pending_ref_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_script_add_pending_ref_post[hIndex].func;
postHookFunc(st, ref);
}
}
return;
}
void HP_script_run_autobonus(const char *autobonus, int id, int pos) {
int hIndex = 0;
if( HPMHooks.count.HP_script_run_autobonus_pre ) {
Expand Down

0 comments on commit 1d12bb1

Please sign in to comment.