diff options
Diffstat (limited to 'src/emap/script_buildins.c')
-rw-r--r-- | src/emap/script_buildins.c | 14 |
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) { |