diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-31 23:32:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-31 23:32:06 +0300 |
commit | 359730d16f0444da91d678302260a903b18be607 (patch) | |
tree | cc123ee2a086d604b58be92ef8d23c5bf0bc2aaf /src/map/script.c | |
parent | 7942a5a3d653589631850b6560e04503bf304175 (diff) | |
download | evol-hercules-359730d16f0444da91d678302260a903b18be607.tar.gz evol-hercules-359730d16f0444da91d678302260a903b18be607.tar.bz2 evol-hercules-359730d16f0444da91d678302260a903b18be607.tar.xz evol-hercules-359730d16f0444da91d678302260a903b18be607.zip |
add script function what return current map name.
New script function: getmapname
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index 97e973d..79e6043 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -699,3 +699,15 @@ BUILDIN(setNpcDialogTitle) send_changenpc_title(sd, st->oid, name); return true; } + +BUILDIN(getMapName) +{ + TBL_PC *sd = script->rid2sd(st); + if (!sd || sd->bl.m == -1) + { + script_pushstr(st, aStrdup("")); + return 1; + } + script_pushstr(st, aStrdup(map->list[sd->bl.m].name)); + return 0; +} |