Reset taggroup iterator on successive calls

This commit is contained in:
James R 2020-12-05 02:08:00 -08:00
parent 8dd964e3a7
commit 5d1040c924

View file

@ -75,6 +75,8 @@ struct element_iterator_state {
static int element_iterator(lua_State *L)
{
struct element_iterator_state * state = lua_touserdata(L, 1);
if (lua_isnoneornil(L, 3))
state->p = 0;
lua_pushnumber(L, ++state->p);
lua_gettable(L, 1);
return 1;