Skip to content

Commit

Permalink
HPM Hooks Update
Browse files Browse the repository at this point in the history
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
  • Loading branch information
HerculesWSAPI committed Jul 9, 2014
1 parent 1eee0fd commit 660d7eb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 27 deletions.
8 changes: 4 additions & 4 deletions src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4953,8 +4953,8 @@ struct {
struct HPMHookPoint *HP_unit_walktobl_post;
struct HPMHookPoint *HP_unit_run_pre;
struct HPMHookPoint *HP_unit_run_post;
struct HPMHookPoint *HP_unit_wugdash_pre;
struct HPMHookPoint *HP_unit_wugdash_post;
struct HPMHookPoint *HP_unit_run_hit_pre;
struct HPMHookPoint *HP_unit_run_hit_post;
struct HPMHookPoint *HP_unit_escape_pre;
struct HPMHookPoint *HP_unit_escape_post;
struct HPMHookPoint *HP_unit_movepos_pre;
Expand Down Expand Up @@ -9988,8 +9988,8 @@ struct {
int HP_unit_walktobl_post;
int HP_unit_run_pre;
int HP_unit_run_post;
int HP_unit_wugdash_pre;
int HP_unit_wugdash_post;
int HP_unit_run_hit_pre;
int HP_unit_run_hit_post;
int HP_unit_escape_pre;
int HP_unit_escape_post;
int HP_unit_movepos_pre;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/HPMHooking/HPMHooking.HookingPoints.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2516,7 +2516,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(unit->walktobl_sub, HP_unit_walktobl_sub) },
{ HP_POP(unit->walktobl, HP_unit_walktobl) },
{ HP_POP(unit->run, HP_unit_run) },
{ HP_POP(unit->wugdash, HP_unit_wugdash) },
{ HP_POP(unit->run_hit, HP_unit_run_hit) },
{ HP_POP(unit->escape, HP_unit_escape) },
{ HP_POP(unit->movepos, HP_unit_movepos) },
{ HP_POP(unit->setdir, HP_unit_setdir) },
Expand Down
43 changes: 21 additions & 22 deletions src/plugins/HPMHooking/HPMHooking.Hooks.inc
Original file line number Diff line number Diff line change
Expand Up @@ -66624,59 +66624,58 @@ int HP_unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, i
}
return retVal___;
}
int HP_unit_run(struct block_list *bl) {
bool HP_unit_run(struct block_list *bl, struct map_session_data *sd, enum sc_type type) {
int hIndex = 0;
int retVal___ = 0;
bool retVal___ = false;
if( HPMHooks.count.HP_unit_run_pre ) {
int (*preHookFunc) (struct block_list *bl);
bool (*preHookFunc) (struct block_list *bl, struct map_session_data *sd, enum sc_type *type);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_run_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_unit_run_pre[hIndex].func;
retVal___ = preHookFunc(bl);
retVal___ = preHookFunc(bl, sd, &type);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
return retVal___;
}
}
{
retVal___ = HPMHooks.source.unit.run(bl);
retVal___ = HPMHooks.source.unit.run(bl, sd, type);
}
if( HPMHooks.count.HP_unit_run_post ) {
int (*postHookFunc) (int retVal___, struct block_list *bl);
bool (*postHookFunc) (bool retVal___, struct block_list *bl, struct map_session_data *sd, enum sc_type *type);
for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_run_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_unit_run_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl);
retVal___ = postHookFunc(retVal___, bl, sd, &type);
}
}
return retVal___;
}
int HP_unit_wugdash(struct block_list *bl, struct map_session_data *sd) {
void HP_unit_run_hit(struct block_list *bl, struct status_change *sc, struct map_session_data *sd, enum sc_type type) {
int hIndex = 0;
int retVal___ = 0;
if( HPMHooks.count.HP_unit_wugdash_pre ) {
int (*preHookFunc) (struct block_list *bl, struct map_session_data *sd);
if( HPMHooks.count.HP_unit_run_hit_pre ) {
void (*preHookFunc) (struct block_list *bl, struct status_change *sc, struct map_session_data *sd, enum sc_type *type);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_wugdash_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_unit_wugdash_pre[hIndex].func;
retVal___ = preHookFunc(bl, sd);
for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_run_hit_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_unit_run_hit_pre[hIndex].func;
preHookFunc(bl, sc, sd, &type);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
return retVal___;
return;
}
}
{
retVal___ = HPMHooks.source.unit.wugdash(bl, sd);
HPMHooks.source.unit.run_hit(bl, sc, sd, type);
}
if( HPMHooks.count.HP_unit_wugdash_post ) {
int (*postHookFunc) (int retVal___, struct block_list *bl, struct map_session_data *sd);
for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_wugdash_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_unit_wugdash_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, sd);
if( HPMHooks.count.HP_unit_run_hit_post ) {
void (*postHookFunc) (struct block_list *bl, struct status_change *sc, struct map_session_data *sd, enum sc_type *type);
for(hIndex = 0; hIndex < HPMHooks.count.HP_unit_run_hit_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_unit_run_hit_post[hIndex].func;
postHookFunc(bl, sc, sd, &type);
}
}
return retVal___;
return;
}
int HP_unit_escape(struct block_list *bl, struct block_list *target, short dist) {
int hIndex = 0;
Expand Down

0 comments on commit 660d7eb

Please sign in to comment.