Skip to content

Commit

Permalink
Allow timers to be de-activated by passing -1.
Browse files Browse the repository at this point in the history
  • Loading branch information
gabordemooij committed Sep 18, 2024
1 parent d9f27f4 commit 4530c90
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/media/media.c
Original file line number Diff line number Diff line change
Expand Up @@ -1191,8 +1191,10 @@ ctr_object* ctr_media_timer(ctr_object* myself, ctr_argument* argumentList) {
int ms = (int) ctr_tonum(ctr_internal_cast2number(argumentList->next->object));
if (timer_no < 1 || timer_no > CtrMaxMediaTimers) {
ctr_error("Invalid timer", 0);
} else {
} else if ( ms > -1 ) {
CtrMediaTimers[timer_no] = CtrMediaTicks2 + ms;
} else {
CtrMediaTimers[timer_no] = -1;
}
return myself;
}
Expand Down

0 comments on commit 4530c90

Please sign in to comment.