summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorSkotlex <Skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-08-11 15:56:30 +0000
committerSkotlex <Skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-08-11 15:56:30 +0000
commit94b9c4cc347f4c7a3745d001414e565dbf839b62 (patch)
treef01c44e000b7ed01ff86dfed1378e52911a0ac61 /src/map/script.c
parentca008d79a6b5024e55cd5423e577974a5017704c (diff)
downloadhercules-94b9c4cc347f4c7a3745d001414e565dbf839b62.tar.gz
hercules-94b9c4cc347f4c7a3745d001414e565dbf839b62.tar.bz2
hercules-94b9c4cc347f4c7a3745d001414e565dbf839b62.tar.xz
hercules-94b9c4cc347f4c7a3745d001414e565dbf839b62.zip
- Oh, forgot to make unitwarp support the mapname "this"
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14934 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index c61b6d184..4c77bf872 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -13452,9 +13452,10 @@ BUILDIN_FUNC(unitwarp)
short x;
short y;
struct block_list* bl;
+ const char *mapname;
unit_id = script_getnum(st,2);
- map = map_mapname2mapid(script_getstr(st, 3));
+ mapname = script_getstr(st, 3);
x = (short)script_getnum(st,4);
y = (short)script_getnum(st,5);
@@ -13462,6 +13463,12 @@ BUILDIN_FUNC(unitwarp)
bl = map_id2bl(st->rid);
else
bl = map_id2bl(unit_id);
+
+ if( strcmp(mapname,"this") == 0 )
+ map = bl?bl->m:-1;
+ else
+ map = map_mapname2mapid(mapname);
+
if( map >= 0 && bl != NULL )
script_pushint(st, unit_warp(bl,map,x,y,CLR_OUTSIGHT));
else