From 0c666ccc332859f5fdcd3346165cc07c0503a7d4 Mon Sep 17 00:00:00 2001 From: gumi Date: Fri, 15 Jun 2018 09:38:21 -0400 Subject: allow to pass an account id to buildin_readparam Co-authored-by: "Wolfie" --- src/map/script.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/map/script.c b/src/map/script.c index d9350081a..f74debabb 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -8597,7 +8597,8 @@ BUILDIN(disableitemuse) * return the basic stats of sd * chk pc->readparam for available type *------------------------------------------*/ -BUILDIN(readparam) { +BUILDIN(readparam) +{ int type; struct map_session_data *sd; struct script_data *data = script_getdata(st, 2); @@ -8609,7 +8610,11 @@ BUILDIN(readparam) { } if (script_hasdata(st, 3)) { - sd = script->nick2sd(st, script_getstr(st, 3)); + if (script_isstringtype(st, 3)) { + sd = script->nick2sd(st, script_getstr(st, 3)); + } else { + sd = script->id2sd(st, script_getnum(st, 3)); + } } else { sd = script->rid2sd(st); } @@ -18157,7 +18162,7 @@ BUILDIN(setpcblock) if ((type & PCBLOCK_IMMUNE) != 0) sd->block_action.immune = state; - if ((type & PCBLOCK_SITSTAND) != 0) + if ((type & PCBLOCK_SITSTAND) != 0) sd->block_action.sitstand = state; if ((type & PCBLOCK_COMMANDS) != 0) @@ -25263,7 +25268,7 @@ void script_hardcoded_constants(void) script->set_constant("MST_AROUND3", MST_AROUND3, false, false); script->set_constant("MST_AROUND4", MST_AROUND4, false, false); script->set_constant("MST_AROUND", MST_AROUND , false, false); - + script->constdb_comment("pc block constants, use with *setpcblock* and *checkpcblock*"); script->set_constant("PCBLOCK_NONE", PCBLOCK_NONE, false, false); script->set_constant("PCBLOCK_MOVE", PCBLOCK_MOVE, false, false); -- cgit v1.2.3-70-g09d2