luatpt_getPartIndex now passes a negative (invalid) index when it fails
This commit is contained in:
parent
c44e734abe
commit
7ab6a7e7d7
@ -1761,7 +1761,7 @@ int luatpt_next_getPartIndex(lua_State* l)
|
|||||||
getPartIndex_curIdx++;
|
getPartIndex_curIdx++;
|
||||||
if (getPartIndex_curIdx >= NPART)
|
if (getPartIndex_curIdx >= NPART)
|
||||||
{
|
{
|
||||||
getPartIndex_curIdx = 0;
|
getPartIndex_curIdx = -1;
|
||||||
lua_pushboolean(l, 0);
|
lua_pushboolean(l, 0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1778,7 +1778,7 @@ int luatpt_getPartIndex(lua_State* l)
|
|||||||
{
|
{
|
||||||
if(getPartIndex_curIdx < 0)
|
if(getPartIndex_curIdx < 0)
|
||||||
{
|
{
|
||||||
lua_pushinteger(l, 0);
|
lua_pushinteger(l, -1);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
lua_pushinteger(l, getPartIndex_curIdx);
|
lua_pushinteger(l, getPartIndex_curIdx);
|
||||||
|
Loading…
Reference in New Issue
Block a user