From 3731a8e9a30f1fd9b30f99f94e2fe62bbdb285a1 Mon Sep 17 00:00:00 2001 From: mekolat Date: Wed, 14 Oct 2015 15:58:59 -0400 Subject: add more params, allow get/set to use char id --- src/map/script-fun.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'src/map/script-fun.cpp') diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 3592095..f7108d0 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -995,7 +995,19 @@ void builtin_set(ScriptState *st) } else { - id = wrap(conv_num(st, sdata)); + int num = conv_num(st, sdata); + if (num >= 2000000) + id = wrap(num); + else if (num >= 150000) + { + dumb_ptr p_sd = nullptr; + if ((p_sd = map_nick2sd(map_charid2nick(wrap(num)))) != nullptr) + id = p_sd->bl_id; + else + return; + } + else + return; bl = map_id2bl(id); } } @@ -3399,7 +3411,19 @@ void builtin_get(ScriptState *st) } else { - id = wrap(conv_num(st, sdata)); + int num = conv_num(st, sdata); + if (num >= 2000000) + id = wrap(num); + else if (num >= 150000) + { + dumb_ptr p_sd = nullptr; + if ((p_sd = map_nick2sd(map_charid2nick(wrap(num)))) != nullptr) + id = p_sd->bl_id; + else + return; + } + else + return; bl = map_id2bl(id); } -- cgit v1.2.3-60-g2f50