diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/script.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/map/script.c b/src/map/script.c index a63f1e835..536061307 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -8822,10 +8822,15 @@ static BUILDIN(getcharid) int num = script_getnum(st, 2); struct map_session_data *sd; - if (script_hasdata(st, 3)) - sd = map->nick2sd(script_getstr(st, 3), false); - else + if (script_hasdata(st, 3)) { + if (script_isstringtype(st, 3)) { + sd = map->nick2sd(script_getstr(st, 3), false); + } else { + sd = map->id2sd(script_getnum(st, 3)); + } + } else { sd = script->rid2sd(st); + } if (sd == NULL) { script_pushint(st, 0); //return 0, according docs |