diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-09-27 21:02:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-09-27 21:02:46 +0300 |
commit | b1b7c5a06d59bd7c31e152c9981353b78d32a843 (patch) | |
tree | acb3a153e0c777ada80d408714991c589c4869cb /src/emap/script.c | |
parent | 0b276d0c03962418d96b7112180ba852cdceaebd (diff) | |
download | plugin-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.c | 22 |
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; } |