summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-27 22:37:04 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-27 22:37:04 +0300
commitb27b261aff5f230d9fbd9cdf75dfd5540ef739b4 (patch)
tree52b74dab4dae5ab4813813376259d0138b0092b5
parent9dc859a78058ce358c1e3a0ab41c78f7fd198689 (diff)
downloadevol-hercules-b27b261aff5f230d9fbd9cdf75dfd5540ef739b4.tar.gz
evol-hercules-b27b261aff5f230d9fbd9cdf75dfd5540ef739b4.tar.bz2
evol-hercules-b27b261aff5f230d9fbd9cdf75dfd5540ef739b4.tar.xz
evol-hercules-b27b261aff5f230d9fbd9cdf75dfd5540ef739b4.zip
Allow get npc map by reading variable '.map$'.
-rw-r--r--src/emap/script.c13
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;
}