summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorgumi <git@gumi.ca>2018-06-15 09:38:21 -0400
committergumi <git@gumi.ca>2018-06-15 10:28:01 -0400
commit0c666ccc332859f5fdcd3346165cc07c0503a7d4 (patch)
tree5378a6e8b059e2c6eab0e537d6494c9c4e99ae79 /src/map/script.c
parentfb16806ce0588414c5b808df535b72ef9e7ff6ba (diff)
downloadhercules-0c666ccc332859f5fdcd3346165cc07c0503a7d4.tar.gz
hercules-0c666ccc332859f5fdcd3346165cc07c0503a7d4.tar.bz2
hercules-0c666ccc332859f5fdcd3346165cc07c0503a7d4.tar.xz
hercules-0c666ccc332859f5fdcd3346165cc07c0503a7d4.zip
allow to pass an account id to buildin_readparam
Co-authored-by: "Wolfie" <ryan.tana55@gmail.com>
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c13
1 files 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);