summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorsmokexyz <sagunkho@hotmail.com>2017-03-31 11:11:07 +0800
committerGitHub <noreply@github.com>2017-03-31 11:11:07 +0800
commit5f3d37c89c60ecc89186fa8d6cba333369a8f4cf (patch)
treefdf5a5030ae449c69f026833ca0252f253396df9 /src/map/script.c
parentbf7bdd16899e1fafd3717595679591fb51729a7f (diff)
parent4cb8dedbe87523475bbf589f6dc627f3c8e8f7c4 (diff)
downloadhercules-5f3d37c89c60ecc89186fa8d6cba333369a8f4cf.tar.gz
hercules-5f3d37c89c60ecc89186fa8d6cba333369a8f4cf.tar.bz2
hercules-5f3d37c89c60ecc89186fa8d6cba333369a8f4cf.tar.xz
hercules-5f3d37c89c60ecc89186fa8d6cba333369a8f4cf.zip
Merge pull request #1544 from HerculesWS/1543-fix
getstatus() Update
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/map/script.c b/src/map/script.c
index ce740e81b..25f520450 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -11792,14 +11792,16 @@ BUILDIN(getstatus)
case 3: script_pushint(st, sd->sc.data[id]->val3); break;
case 4: script_pushint(st, sd->sc.data[id]->val4); break;
case 5:
- {
- const struct TimerData *td = timer->get(sd->sc.data[id]->timer);
+ if (sd->sc.data[id]->infinite_duration) {
+ script_pushint(st, INFINITE_DURATION);
+ } else {
+ const struct TimerData *td = timer->get(sd->sc.data[id]->timer);
- if (td != NULL) {
- // return the amount of time remaining
- script_pushint(st, (int)(td->tick - timer->gettick())); // TODO: change this to int64 when we'll support 64 bit script values
+ if (td != NULL) {
+ // return the amount of time remaining
+ script_pushint(st, (int)(td->tick - timer->gettick())); // TODO: change this to int64 when we'll support 64 bit script values
+ }
}
- }
break;
default: script_pushint(st, 1); break;
}