summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-05-06 20:09:57 -0300
committerJesusaves <cpntb1@ymail.com>2019-05-06 20:09:57 -0300
commit9b1493838b6655f15fc33c2e2fe7dc7d85632e45 (patch)
tree8acdc4f57b0d34693d73953a2824180a18d93409
parent8461835e454de7b58877dd1d9def10d9be459c7a (diff)
downloadevol-hercules-9b1493838b6655f15fc33c2e2fe7dc7d85632e45.tar.gz
evol-hercules-9b1493838b6655f15fc33c2e2fe7dc7d85632e45.tar.bz2
evol-hercules-9b1493838b6655f15fc33c2e2fe7dc7d85632e45.tar.xz
evol-hercules-9b1493838b6655f15fc33c2e2fe7dc7d85632e45.zip
ispcdead("someone") is now supported for TMW2
-rw-r--r--src/emap/init.c2
-rw-r--r--src/emap/script_buildins.c10
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);