summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-05-01 20:29:07 -0400
committermekolat <mekolat@users.noreply.github.com>2016-05-01 20:29:07 -0400
commit7b14630d3f4282ecb6ab576af26a7a109615a885 (patch)
tree5d03c8589926126a07fc5d75cb4c72887188131b
parent16c91bb089873729a0a923b267fb0f0afd980925 (diff)
parent1bb3a0949355edffe933d58db113e4e21cdaa923 (diff)
downloadtmwa-7b14630d3f4282ecb6ab576af26a7a109615a885.tar.gz
tmwa-7b14630d3f4282ecb6ab576af26a7a109615a885.tar.bz2
tmwa-7b14630d3f4282ecb6ab576af26a7a109615a885.tar.xz
tmwa-7b14630d3f4282ecb6ab576af26a7a109615a885.zip
Merge pull request #215 from wushin/target-to-location
Enable script PC location scripts to take target ids
-rw-r--r--src/map/script-fun.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp
index 18d89a0..64ce156 100644
--- a/src/map/script-fun.cpp
+++ b/src/map/script-fun.cpp
@@ -584,6 +584,7 @@ void builtin_warp(ScriptState *st)
MapName str = stringish<MapName>(ZString(conv_str(st, &AARG(0))));
x = conv_num(st, &AARG(1));
y = conv_num(st, &AARG(2));
+
pc_setpos(sd, str, x, y, BeingRemoveWhy::GONE);
}
@@ -4561,7 +4562,12 @@ void builtin_getdir(ScriptState *st)
static
void builtin_getmap(ScriptState *st)
{
- dumb_ptr<map_session_data> sd = script_rid2sd(st);
+ dumb_ptr<map_session_data> sd;
+
+ if (HARG(0)) //指定したキャラを状態異常にする
+ sd = map_id_is_player(wrap<BlockId>(conv_num(st, &AARG(0))));
+ else
+ sd = script_rid2sd(st);
push_str<ScriptDataStr>(st->stack, sd->bl_m->name_);
}
@@ -4830,7 +4836,7 @@ BuiltinFunction builtin_functions[] =
BUILTIN(getnpcx, "?"_s, 'i'),
BUILTIN(getnpcy, "?"_s, 'i'),
BUILTIN(strnpcinfo, "i?"_s, 's'),
- BUILTIN(getmap, ""_s, 's'),
+ BUILTIN(getmap, "?"_s, 's'),
BUILTIN(mapexit, ""_s, '\0'),
BUILTIN(freeloop, "i"_s, '\0'),
BUILTIN(if_then_else, "iii"_s, '.'),