diff options
author | Haru <haru@dotalux.com> | 2020-05-27 12:40:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-27 12:40:47 +0200 |
commit | fcffb676132949852adfef2fd3f814485f964709 (patch) | |
tree | b00e7b948150ab9c500e9d61b9a11cdd0fe26ad0 /src/map/script.h | |
parent | 3d9317d3a0bb200b9262be8fb882f33b40bfbd2e (diff) | |
parent | 6aed6b4f7c669c3760c5ebd32b40fbb7da1d5715 (diff) | |
download | hercules-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/map/script.h')
-rw-r--r-- | src/map/script.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/map/script.h b/src/map/script.h index 5fa81dc0e..df5297ac0 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -584,6 +584,8 @@ enum itemskill_flag { struct Script_Config { bool warn_func_mismatch_argtypes; bool warn_func_mismatch_paramnum; + bool functions_private_by_default; + bool functions_as_events; int check_cmdcount; int check_gotocount; int input_min_value; @@ -725,8 +727,14 @@ struct str_data_struct { uint8 deprecated : 1; }; +/** a label within a script (does not use the label db) */ struct script_label_entry { - int key,pos; + /** label name (held within str_data) */ + int key; + /** position within the script */ + int pos; + /** optional flags for the label */ + enum script_label_flags flags; }; struct script_syntax_data { @@ -917,7 +925,7 @@ struct script_interface { void (*set_constant) (const char *name, int value, bool is_parameter, bool is_deprecated); void (*set_constant2) (const char *name, int value, bool is_parameter, bool is_deprecated); bool (*get_constant) (const char* name, int* value); - void (*label_add)(int key, int pos); + void (*label_add)(int key, int pos, enum script_label_flags flags); void (*run) (struct script_code *rootscript, int pos, int rid, int oid); void (*run_npc) (struct script_code *rootscript, int pos, int rid, int oid); void (*run_pet) (struct script_code *rootscript, int pos, int rid, int oid); @@ -948,10 +956,11 @@ struct script_interface { int (*queue_create) (void); bool (*queue_clear) (int idx); /* */ - const char * (*parse_curly_close) (const char *p); - const char * (*parse_syntax_close) (const char *p); - const char * (*parse_syntax_close_sub) (const char *p, int *flag); - const char * (*parse_syntax) (const char *p); + const char *(*parse_curly_close) (const char *p); + const char *(*parse_syntax_close) (const char *p); + const char *(*parse_syntax_close_sub) (const char *p, int *flag); + const char *(*parse_syntax) (const char *p); + const char *(*parse_syntax_function) (const char *p, bool is_public); c_op (*get_com) (const struct script_buf *scriptbuf, int *pos); int (*get_num) (const struct script_buf *scriptbuf, int *pos); const char* (*op2name) (int op); |