From 1455dab58a381479b196c73b50b42990b9aff580 Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Sun, 26 Aug 2018 17:01:42 +0200 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- src/plugins/HPMHooking/HPMHooking.Defs.inc | 2 ++ .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 4 ++++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 1 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 26 ++++++++++++++++++++++ 4 files changed, 33 insertions(+) diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index c5de44fa9..94ca75f6e 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -4430,6 +4430,8 @@ typedef void (*HPMHOOK_pre_map_zone_change) (int *m, struct map_zone_data **zone typedef void (*HPMHOOK_post_map_zone_change) (int m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath); typedef void (*HPMHOOK_pre_map_zone_change2) (int *m, struct map_zone_data **zone); typedef void (*HPMHOOK_post_map_zone_change2) (int m, struct map_zone_data *zone); +typedef void (*HPMHOOK_pre_map_zone_reload) (void); +typedef void (*HPMHOOK_post_map_zone_reload) (void); typedef int (*HPMHOOK_pre_map_getcell) (int16 *m, const struct block_list **bl, int16 *x, int16 *y, cell_chk *cellchk); typedef int (*HPMHOOK_post_map_getcell) (int retVal___, int16 m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk); typedef void (*HPMHOOK_pre_map_setgatcell) (int16 *m, int16 *x, int16 *y, int *gat); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index d875ab6e2..3b598cd0d 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -3360,6 +3360,8 @@ struct { struct HPMHookPoint *HP_map_zone_change_post; struct HPMHookPoint *HP_map_zone_change2_pre; struct HPMHookPoint *HP_map_zone_change2_post; + struct HPMHookPoint *HP_map_zone_reload_pre; + struct HPMHookPoint *HP_map_zone_reload_post; struct HPMHookPoint *HP_map_getcell_pre; struct HPMHookPoint *HP_map_getcell_post; struct HPMHookPoint *HP_map_setgatcell_pre; @@ -9921,6 +9923,8 @@ struct { int HP_map_zone_change_post; int HP_map_zone_change2_pre; int HP_map_zone_change2_post; + int HP_map_zone_reload_pre; + int HP_map_zone_reload_post; int HP_map_getcell_pre; int HP_map_getcell_post; int HP_map_setgatcell_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 0088847b1..70ea54928 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1723,6 +1723,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(map->zone_apply, HP_map_zone_apply) }, { HP_POP(map->zone_change, HP_map_zone_change) }, { HP_POP(map->zone_change2, HP_map_zone_change2) }, + { HP_POP(map->zone_reload, HP_map_zone_reload) }, { HP_POP(map->getcell, HP_map_getcell) }, { HP_POP(map->setgatcell, HP_map_setgatcell) }, { HP_POP(map->cellfromcache, HP_map_cellfromcache) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 3b21eb3e6..4231eedb7 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -44259,6 +44259,32 @@ void HP_map_zone_change2(int m, struct map_zone_data *zone) { } return; } +void HP_map_zone_reload(void) { + int hIndex = 0; + if (HPMHooks.count.HP_map_zone_reload_pre > 0) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_reload_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_map_zone_reload_pre[hIndex].func; + preHookFunc(); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.map.zone_reload(); + } + if (HPMHooks.count.HP_map_zone_reload_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_reload_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_map_zone_reload_post[hIndex].func; + postHookFunc(); + } + } + return; +} int HP_map_getcell(int16 m, const struct block_list *bl, int16 x, int16 y, cell_chk cellchk) { int hIndex = 0; int retVal___ = 0; -- cgit v1.2.3-60-g2f50