summaryrefslogtreecommitdiff
path: root/src/emap
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-12-04 22:37:14 -0300
committerJesusaves <cpntb1@ymail.com>2022-12-04 22:37:14 -0300
commit8104b80181c85c14265abf29bfb27d38f7cde1aa (patch)
treef3b454e9b2e1b8556d95c67ee211966c48b7c109 /src/emap
parent0e93d3d0e5348ba12497a0b168a173ebf6c034e5 (diff)
downloadevol-hercules-8104b80181c85c14265abf29bfb27d38f7cde1aa.tar.gz
evol-hercules-8104b80181c85c14265abf29bfb27d38f7cde1aa.tar.bz2
evol-hercules-8104b80181c85c14265abf29bfb27d38f7cde1aa.tar.xz
evol-hercules-8104b80181c85c14265abf29bfb27d38f7cde1aa.zip
Fix bug due to stupid syntax
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);