summaryrefslogtreecommitdiff
path: root/src/emap/script_buildins.c
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-09-02 20:23:46 -0300
committerJesusaves <cpntb1@ymail.com>2020-09-02 20:23:46 -0300
commit509db24d2aebea63162bd3699275015f1c92cb7a (patch)
tree18faa61479e1979c0aa6808cd7c0d6ce59093ddc /src/emap/script_buildins.c
parent981c4a67825790a2fb2e1bf22242c6efe4e65967 (diff)
downloadevol-hercules-509db24d2aebea63162bd3699275015f1c92cb7a.tar.gz
evol-hercules-509db24d2aebea63162bd3699275015f1c92cb7a.tar.bz2
evol-hercules-509db24d2aebea63162bd3699275015f1c92cb7a.tar.xz
evol-hercules-509db24d2aebea63162bd3699275015f1c92cb7a.zip
Accept optional param - NPC NAME - on npcwalkto() script function
Diffstat (limited to 'src/emap/script_buildins.c')
-rw-r--r--src/emap/script_buildins.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index 553e8b1..85e81b2 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -1463,11 +1463,23 @@ BUILDIN(npcStand)
BUILDIN(npcWalkTo)
{
- struct npc_data *nd = map->id2nd(st->oid);
+ struct npc_data *nd = NULL;
int x = 0, y = 0;
x = script_getnum(st, 2);
y = script_getnum(st, 3);
+ if (script_hasdata(st, 4) && script_isstringtype(st, 4))
+ {
+ nd = npc->name2id(script_getstr(st, 4));
+ }
+ else if (script_hasdata(st, 4))
+ {
+ nd = map->id2nd(script_getnum(st, 4));
+ }
+ else
+ {
+ nd = map->id2nd(st->oid);
+ }
if (nd)
{