From 8104b80181c85c14265abf29bfb27d38f7cde1aa Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 4 Dec 2022 22:37:14 -0300 Subject: Fix bug due to stupid syntax --- src/emap/script_buildins.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index 540d59a..4c43a26 100644 --- a/src/emap/script_buildins.c +++ b/src/emap/script_buildins.c @@ -1071,17 +1071,21 @@ BUILDIN(unequipById) BUILDIN(isPcDead) { - TBL_PC *sd = script->rid2sd(st); + TBL_PC *sd; + if (script_hasdata(st, 2)) { + if (script_isstringtype(st, 2)) + sd = script->nick2sd(st, script_getstr(st, 2)); + else + sd = map->id2sd(script_getnum(st, 2)); + } else { + sd = script->rid2sd(st); + } if (sd == NULL) { - sd = script->nick2sd(st, script_getstr(st, 2)); - if (sd == NULL) - { - ShowWarning("player not attached\n"); - script->reportsrc(st); - return false; - } + ShowWarning("player not attached\n"); + script->reportsrc(st); + return false; } script_pushint(st, pc_isdead(sd) ? 1 : 0); -- cgit v1.2.3-60-g2f50