summaryrefslogtreecommitdiff
path: root/src/emap/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-27 21:02:46 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-27 21:02:46 +0300
commitb1b7c5a06d59bd7c31e152c9981353b78d32a843 (patch)
treeacb3a153e0c777ada80d408714991c589c4869cb /src/emap/script.c
parent0b276d0c03962418d96b7112180ba852cdceaebd (diff)
downloadplugin-b1b7c5a06d59bd7c31e152c9981353b78d32a843.tar.gz
plugin-b1b7c5a06d59bd7c31e152c9981353b78d32a843.tar.bz2
plugin-b1b7c5a06d59bd7c31e152c9981353b78d32a843.tar.xz
plugin-b1b7c5a06d59bd7c31e152c9981353b78d32a843.zip
Allow read npc position by .x and .y variables.
Diffstat (limited to 'src/emap/script.c')
-rw-r--r--src/emap/script.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/emap/script.c b/src/emap/script.c
index e28270b..95aa747 100644
--- a/src/emap/script.c
+++ b/src/emap/script.c
@@ -84,6 +84,16 @@ void escript_set_reg_npc_num(struct script_state* st, struct reg_db *n, int64 *n
nd->dir = newdir;
npc->enable(nd->name, 1);
}
+ else if (!strcmp(name, ".x"))
+ {
+ ShowWarning("you cant assign '.x'\n");
+ script->reportsrc(st);
+ }
+ else if (!strcmp(name, ".y"))
+ {
+ ShowWarning("you cant assign '.y'.\n");
+ script->reportsrc(st);
+ }
}
int escript_get_val_npcscope_num(struct script_state* st, struct reg_db *n, struct script_data* data)
@@ -114,6 +124,18 @@ int escript_get_val_npcscope_num(struct script_state* st, struct reg_db *n, stru
hookStop();
return nd->dir;
}
+ else if (!strcmp(name, ".x"))
+ {
+ getNDReturn(0);
+ hookStop();
+ return nd->bl.x;
+ }
+ else if (!strcmp(name, ".y"))
+ {
+ getNDReturn(0);
+ hookStop();
+ return nd->bl.y;
+ }
return 0;
}