diff options
-rw-r--r-- | src/emap/init.c | 2 | ||||
-rw-r--r-- | src/emap/script_buildins.c | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/emap/init.c b/src/emap/init.c index deabd84..a52e97d 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -167,7 +167,7 @@ HPExport void plugin_init (void) addScriptCommand("setnpcdialogtitle", "s", setNpcDialogTitle); addScriptCommand("getmapname", "", getMapName); addScriptCommand("unequipbyid", "i", unequipById); - addScriptCommand("ispcdead", "", isPcDead); + addScriptCommand("ispcdead", "?", isPcDead); addScriptCommand("getareadropitem", "siiiiv*", getAreaDropItem); addScriptCommand("clientcommand", "s", clientCommand); addScriptCommand("isunitwalking", "?", isUnitWalking); diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c index 5e86a22..ff33a5f 100644 --- a/src/emap/script_buildins.c +++ b/src/emap/script_buildins.c @@ -1000,9 +1000,13 @@ BUILDIN(isPcDead) if (sd == NULL) { - ShowWarning("player not attached\n"); - script->reportsrc(st); - return false; + sd = script->nick2sd(st, script_getstr(st, 2)); + if (sd == NULL) + { + ShowWarning("player not attached\n"); + script->reportsrc(st); + return false; + } } script_pushint(st, pc_isdead(sd) ? 1 : 0); |