diff options
Diffstat (limited to 'src/map/script-fun.cpp')
-rw-r--r-- | src/map/script-fun.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
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<BlockId>(conv_num(st, sdata)); + int num = conv_num(st, sdata); + if (num >= 2000000) + id = wrap<BlockId>(num); + else if (num >= 150000) + { + dumb_ptr<map_session_data> p_sd = nullptr; + if ((p_sd = map_nick2sd(map_charid2nick(wrap<CharId>(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<BlockId>(conv_num(st, sdata)); + int num = conv_num(st, sdata); + if (num >= 2000000) + id = wrap<BlockId>(num); + else if (num >= 150000) + { + dumb_ptr<map_session_data> p_sd = nullptr; + if ((p_sd = map_nick2sd(map_charid2nick(wrap<CharId>(num)))) != nullptr) + id = p_sd->bl_id; + else + return; + } + else + return; bl = map_id2bl(id); } |