summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgumi <mekolat@users.noreply.github.com>2017-03-05 12:23:13 -0500
committergumi <mekolat@users.noreply.github.com>2017-03-05 13:32:09 -0500
commit0920136eab9db973c3fc8aff2f6d7cdcd389d00e (patch)
tree1e6a02cc4e5205695b9a50dd8e9b849b7526ad0e
parent96a0bb83a3c679b376c6ee3c17c3c732d5f9b8f7 (diff)
downloadhercules-0920136eab9db973c3fc8aff2f6d7cdcd389d00e.tar.gz
hercules-0920136eab9db973c3fc8aff2f6d7cdcd389d00e.tar.bz2
hercules-0920136eab9db973c3fc8aff2f6d7cdcd389d00e.tar.xz
hercules-0920136eab9db973c3fc8aff2f6d7cdcd389d00e.zip
make addtimer return success or failure
-rw-r--r--src/map/script.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 950242e77..6d6ce4e85 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10792,14 +10792,18 @@ BUILDIN(addtimer)
script->check_event(st, event);
sd = script->rid2sd(st);
- if (sd == NULL)
- return true;
+ if (sd == NULL) {
+ script_pushint(st, 0);
+ return false;
+ }
if (!pc->addeventtimer(sd, tick, event)) {
ShowWarning("script:addtimer: Event timer is full, can't add new event timer. (cid:%d timer:%s)\n", sd->status.char_id, event);
+ script_pushint(st, 0);
return false;
}
+ script_pushint(st, 1);
return true;
}
/*==========================================