summaryrefslogtreecommitdiff
path: root/src/emap
diff options
context:
space:
mode:
Diffstat (limited to 'src/emap')
-rw-r--r--src/emap/script_buildins.c20
1 files 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);