summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2020-05-27 12:40:47 +0200
committerGitHub <noreply@github.com>2020-05-27 12:40:47 +0200
commitfcffb676132949852adfef2fd3f814485f964709 (patch)
treeb00e7b948150ab9c500e9d61b9a11cdd0fe26ad0 /src/plugins
parent3d9317d3a0bb200b9262be8fb882f33b40bfbd2e (diff)
parent6aed6b4f7c669c3760c5ebd32b40fbb7da1d5715 (diff)
downloadhercules-fcffb676132949852adfef2fd3f814485f964709.tar.gz
hercules-fcffb676132949852adfef2fd3f814485f964709.tar.bz2
hercules-fcffb676132949852adfef2fd3f814485f964709.tar.xz
hercules-fcffb676132949852adfef2fd3f814485f964709.zip
Merge pull request #2142 from Helianthella/export2
allow local NPC functions to be public or private
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc6
-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.inc39
4 files changed, 42 insertions, 8 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index ef71f1967..d20766956 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -6858,8 +6858,8 @@ typedef void (*HPMHOOK_pre_script_set_constant2) (const char **name, int *value,
typedef void (*HPMHOOK_post_script_set_constant2) (const char *name, int value, bool is_parameter, bool is_deprecated);
typedef bool (*HPMHOOK_pre_script_get_constant) (const char **name, int **value);
typedef bool (*HPMHOOK_post_script_get_constant) (bool retVal___, const char *name, int *value);
-typedef void (*HPMHOOK_pre_script_label_add) (int *key, int *pos);
-typedef void (*HPMHOOK_post_script_label_add) (int key, int pos);
+typedef void (*HPMHOOK_pre_script_label_add) (int *key, int *pos, enum script_label_flags *flags);
+typedef void (*HPMHOOK_post_script_label_add) (int key, int pos, enum script_label_flags flags);
typedef void (*HPMHOOK_pre_script_run) (struct script_code **rootscript, int *pos, int *rid, int *oid);
typedef void (*HPMHOOK_post_script_run) (struct script_code *rootscript, int pos, int rid, int oid);
typedef void (*HPMHOOK_pre_script_run_npc) (struct script_code **rootscript, int *pos, int *rid, int *oid);
@@ -6924,6 +6924,8 @@ typedef const char* (*HPMHOOK_pre_script_parse_syntax_close_sub) (const char **p
typedef const char* (*HPMHOOK_post_script_parse_syntax_close_sub) (const char* retVal___, const char *p, int *flag);
typedef const char* (*HPMHOOK_pre_script_parse_syntax) (const char **p);
typedef const char* (*HPMHOOK_post_script_parse_syntax) (const char* retVal___, const char *p);
+typedef const char* (*HPMHOOK_pre_script_parse_syntax_function) (const char **p, bool *is_public);
+typedef const char* (*HPMHOOK_post_script_parse_syntax_function) (const char* retVal___, const char *p, bool is_public);
typedef c_op (*HPMHOOK_pre_script_get_com) (const struct script_buf **scriptbuf, int **pos);
typedef c_op (*HPMHOOK_post_script_get_com) (c_op retVal___, const struct script_buf *scriptbuf, int *pos);
typedef int (*HPMHOOK_pre_script_get_num) (const struct script_buf **scriptbuf, int **pos);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index e8cb41240..02ba063ed 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -5454,6 +5454,8 @@ struct {
struct HPMHookPoint *HP_script_parse_syntax_close_sub_post;
struct HPMHookPoint *HP_script_parse_syntax_pre;
struct HPMHookPoint *HP_script_parse_syntax_post;
+ struct HPMHookPoint *HP_script_parse_syntax_function_pre;
+ struct HPMHookPoint *HP_script_parse_syntax_function_post;
struct HPMHookPoint *HP_script_get_com_pre;
struct HPMHookPoint *HP_script_get_com_post;
struct HPMHookPoint *HP_script_get_num_pre;
@@ -12355,6 +12357,8 @@ struct {
int HP_script_parse_syntax_close_sub_post;
int HP_script_parse_syntax_pre;
int HP_script_parse_syntax_post;
+ int HP_script_parse_syntax_function_pre;
+ int HP_script_parse_syntax_function_post;
int HP_script_get_com_pre;
int HP_script_get_com_post;
int HP_script_get_num_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 6b89841ad..4a36c5a1e 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2793,6 +2793,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(script->parse_syntax_close, HP_script_parse_syntax_close) },
{ HP_POP(script->parse_syntax_close_sub, HP_script_parse_syntax_close_sub) },
{ HP_POP(script->parse_syntax, HP_script_parse_syntax) },
+ { HP_POP(script->parse_syntax_function, HP_script_parse_syntax_function) },
{ HP_POP(script->get_com, HP_script_get_com) },
{ HP_POP(script->get_num, HP_script_get_num) },
{ HP_POP(script->op2name, HP_script_op2name) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 02d55228e..f0e395b64 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -71749,14 +71749,14 @@ bool HP_script_get_constant(const char *name, int *value) {
}
return retVal___;
}
-void HP_script_label_add(int key, int pos) {
+void HP_script_label_add(int key, int pos, enum script_label_flags flags) {
int hIndex = 0;
if (HPMHooks.count.HP_script_label_add_pre > 0) {
- void (*preHookFunc) (int *key, int *pos);
+ void (*preHookFunc) (int *key, int *pos, enum script_label_flags *flags);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_script_label_add_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_script_label_add_pre[hIndex].func;
- preHookFunc(&key, &pos);
+ preHookFunc(&key, &pos, &flags);
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -71764,13 +71764,13 @@ void HP_script_label_add(int key, int pos) {
}
}
{
- HPMHooks.source.script.label_add(key, pos);
+ HPMHooks.source.script.label_add(key, pos, flags);
}
if (HPMHooks.count.HP_script_label_add_post > 0) {
- void (*postHookFunc) (int key, int pos);
+ void (*postHookFunc) (int key, int pos, enum script_label_flags flags);
for (hIndex = 0; hIndex < HPMHooks.count.HP_script_label_add_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_script_label_add_post[hIndex].func;
- postHookFunc(key, pos);
+ postHookFunc(key, pos, flags);
}
}
return;
@@ -72625,6 +72625,33 @@ const char* HP_script_parse_syntax(const char *p) {
}
return retVal___;
}
+const char* HP_script_parse_syntax_function(const char *p, bool is_public) {
+ int hIndex = 0;
+ const char* retVal___ = NULL;
+ if (HPMHooks.count.HP_script_parse_syntax_function_pre > 0) {
+ const char* (*preHookFunc) (const char **p, bool *is_public);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_function_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_script_parse_syntax_function_pre[hIndex].func;
+ retVal___ = preHookFunc(&p, &is_public);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.script.parse_syntax_function(p, is_public);
+ }
+ if (HPMHooks.count.HP_script_parse_syntax_function_post > 0) {
+ const char* (*postHookFunc) (const char* retVal___, const char *p, bool is_public);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_script_parse_syntax_function_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_script_parse_syntax_function_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, p, is_public);
+ }
+ }
+ return retVal___;
+}
c_op HP_script_get_com(const struct script_buf *scriptbuf, int *pos) {
int hIndex = 0;
c_op retVal___ = C_NOP;