summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2018-11-13 13:07:16 -0500
committergumi <git@gumi.ca>2018-11-13 13:07:16 -0500
commitafc68b65ad3a2a05eccd578acc2fe71a5f42655a (patch)
treeefb1b7ba094243713ab062f16a0011ee33c4dfcd /src/plugins/HPMHooking
parentc964aa4b43de4e534e1ea421841ee090cc71e6e8 (diff)
downloadhercules-afc68b65ad3a2a05eccd578acc2fe71a5f42655a.tar.gz
hercules-afc68b65ad3a2a05eccd578acc2fe71a5f42655a.tar.bz2
hercules-afc68b65ad3a2a05eccd578acc2fe71a5f42655a.tar.xz
hercules-afc68b65ad3a2a05eccd578acc2fe71a5f42655a.zip
update HPM hooks, for map_zone_remove_all
Diffstat (limited to 'src/plugins/HPMHooking')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc1
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc26
4 files changed, 33 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 81e25f033..72387a8af 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -4458,6 +4458,8 @@ typedef void (*HPMHOOK_pre_map_zone_init) (void);
typedef void (*HPMHOOK_post_map_zone_init) (void);
typedef void (*HPMHOOK_pre_map_zone_remove) (int *m);
typedef void (*HPMHOOK_post_map_zone_remove) (int m);
+typedef void (*HPMHOOK_pre_map_zone_remove_all) (int *m);
+typedef void (*HPMHOOK_post_map_zone_remove_all) (int m);
typedef void (*HPMHOOK_pre_map_zone_apply) (int *m, struct map_zone_data **zone, const char **start, const char **buffer, const char **filepath);
typedef void (*HPMHOOK_post_map_zone_apply) (int m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath);
typedef void (*HPMHOOK_pre_map_zone_change) (int *m, struct map_zone_data **zone, const char **start, const char **buffer, const char **filepath);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index b0b2e7a32..873e82c48 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -3388,6 +3388,8 @@ struct {
struct HPMHookPoint *HP_map_zone_init_post;
struct HPMHookPoint *HP_map_zone_remove_pre;
struct HPMHookPoint *HP_map_zone_remove_post;
+ struct HPMHookPoint *HP_map_zone_remove_all_pre;
+ struct HPMHookPoint *HP_map_zone_remove_all_post;
struct HPMHookPoint *HP_map_zone_apply_pre;
struct HPMHookPoint *HP_map_zone_apply_post;
struct HPMHookPoint *HP_map_zone_change_pre;
@@ -9991,6 +9993,8 @@ struct {
int HP_map_zone_init_post;
int HP_map_zone_remove_pre;
int HP_map_zone_remove_post;
+ int HP_map_zone_remove_all_pre;
+ int HP_map_zone_remove_all_post;
int HP_map_zone_apply_pre;
int HP_map_zone_apply_post;
int HP_map_zone_change_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 508465411..838968ce0 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -1737,6 +1737,7 @@ struct HookingPointData HookingPoints[] = {
/* map_interface */
{ HP_POP(map->zone_init, HP_map_zone_init) },
{ HP_POP(map->zone_remove, HP_map_zone_remove) },
+ { HP_POP(map->zone_remove_all, HP_map_zone_remove_all) },
{ 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) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index fa80a68fd..d8f515444 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -44624,6 +44624,32 @@ void HP_map_zone_remove(int m) {
}
return;
}
+void HP_map_zone_remove_all(int m) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_map_zone_remove_all_pre > 0) {
+ void (*preHookFunc) (int *m);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_remove_all_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_map_zone_remove_all_pre[hIndex].func;
+ preHookFunc(&m);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.map.zone_remove_all(m);
+ }
+ if (HPMHooks.count.HP_map_zone_remove_all_post > 0) {
+ void (*postHookFunc) (int m);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_map_zone_remove_all_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_map_zone_remove_all_post[hIndex].func;
+ postHookFunc(m);
+ }
+ }
+ return;
+}
void HP_map_zone_apply(int m, struct map_zone_data *zone, const char *start, const char *buffer, const char *filepath) {
int hIndex = 0;
if (HPMHooks.count.HP_map_zone_apply_pre > 0) {