diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-09-27 22:37:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-09-27 22:37:04 +0300 |
commit | b27b261aff5f230d9fbd9cdf75dfd5540ef739b4 (patch) | |
tree | 52b74dab4dae5ab4813813376259d0138b0092b5 /src/emap/script.c | |
parent | 9dc859a78058ce358c1e3a0ab41c78f7fd198689 (diff) | |
download | plugin-b27b261aff5f230d9fbd9cdf75dfd5540ef739b4.tar.gz plugin-b27b261aff5f230d9fbd9cdf75dfd5540ef739b4.tar.bz2 plugin-b27b261aff5f230d9fbd9cdf75dfd5540ef739b4.tar.xz plugin-b27b261aff5f230d9fbd9cdf75dfd5540ef739b4.zip |
Allow get npc map by reading variable '.map$'.
Diffstat (limited to 'src/emap/script.c')
-rw-r--r-- | src/emap/script.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/emap/script.c b/src/emap/script.c index 05266d1..6675f78 100644 --- a/src/emap/script.c +++ b/src/emap/script.c @@ -175,10 +175,23 @@ int escript_get_val_npcscope_num(struct script_state* st, struct reg_db *n, stru void escript_set_reg_npc_str(struct script_state* st, struct reg_db *n, int64 *num, const char* name, const char *str) { + if (!strcmp(name, ".map$")) + { + ShowWarning("you cant assign '.map$'.\n"); + script->reportsrc(st); + hookStop(); + } } char *escript_get_val_npcscope_str(struct script_state* st, struct reg_db *n, struct script_data* data) { + const char *name = reference_getname(data); + if (!strcmp(name, ".map$")) + { + getNDReturn(0); + hookStop(); + return map->list[nd->bl.m].name; + } return NULL; } |