setting interval to 0 disables the timer

This commit is contained in:
Andre Leiradella 2015-05-25 10:21:58 -03:00
parent 1680718300
commit 1aa6700669

View File

@ -24,7 +24,7 @@ static int l_tick( lua_State* L )
{
gwlua_timer_t* self = l_check( L, 1 );
if ( self->is_enabled && self->callback_ref != LUA_NOREF && self->state->now >= self->expiration )
if ( self->is_enabled && self->callback_ref != LUA_NOREF && self->interval && self->state->now >= self->expiration )
{
self->expiration = self->interval + self->state->now;