diff options
author | gumi <git@gumi.ca> | 2018-03-25 12:47:57 -0400 |
---|---|---|
committer | gumi <git@gumi.ca> | 2018-03-25 13:54:10 -0400 |
commit | 8049f5470fbb0c2dc2cf23e5aee5fd450f45a776 (patch) | |
tree | 2a0f64987c663d8a2f3a4614524380f9bae5cacd /npc/functions | |
parent | 3605ca68d55461cb1da9b01f41f5d2c0ff514503 (diff) | |
download | serverdata-8049f5470fbb0c2dc2cf23e5aee5fd450f45a776.tar.gz serverdata-8049f5470fbb0c2dc2cf23e5aee5fd450f45a776.tar.bz2 serverdata-8049f5470fbb0c2dc2cf23e5aee5fd450f45a776.tar.xz serverdata-8049f5470fbb0c2dc2cf23e5aee5fd450f45a776.zip |
get map anchors directly from maps
Diffstat (limited to 'npc/functions')
-rw-r--r-- | npc/functions/warp.txt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/npc/functions/warp.txt b/npc/functions/warp.txt index 844baf7d..dd09d713 100644 --- a/npc/functions/warp.txt +++ b/npc/functions/warp.txt @@ -27,21 +27,22 @@ function script slide_or_warp { } if (!isloggedin(.@aid)) { - if (.@aid = playerattached() == 0) { + if ((.@aid = playerattached()) == 0) { debugmes("slide_or_warp: no player attached!"); return false; } } getmapxy(.@pc_map$, .@pc_x, .@pc_y, UNITTYPE_PC, .@aid); // get char location + .@cid = getcharid(CHAR_ID_CHAR, strcharinfo(PC_NAME, .@aid)); // FIXME: [Hercules] make it so you can pass account id directly to getcharid if (getargcount() < 1) { - warpchar(.@pc_map$, .@pc_x, .@pc_y, .@aid); // no arguments, just refresh + warpchar(.@pc_map$, .@pc_x, .@pc_y, .@cid); // no arguments, just refresh } else if (.@map$ == .@pc_map$ && (.@pc_x != .@x || .@pc_y != .@y)) { slide(.@x, .@y); // same map, slide instead of full warp // FIXME: make slide take GID as optional arg } else { - warpchar(.@map$, .@x, .@y, .@aid); // different map, warp to given location + warpchar(.@map$, .@x, .@y, .@cid); // different map, warp to given location } return true; } |