1
0
mirror of https://github.com/The-Powder-Toy/The-Powder-Toy.git synced 2025-04-27 18:22:06 +02:00

luatpt_getPartIndex now passes a negative (invalid) index when it fails

This commit is contained in:
boxmein 2014-06-13 00:25:18 +03:00
parent c44e734abe
commit 7ab6a7e7d7

@ -1761,7 +1761,7 @@ int luatpt_next_getPartIndex(lua_State* l)
getPartIndex_curIdx++;
if (getPartIndex_curIdx >= NPART)
{
getPartIndex_curIdx = 0;
getPartIndex_curIdx = -1;
lua_pushboolean(l, 0);
return 1;
}
@ -1778,7 +1778,7 @@ int luatpt_getPartIndex(lua_State* l)
{
if(getPartIndex_curIdx < 0)
{
lua_pushinteger(l, 0);
lua_pushinteger(l, -1);
return 1;
}
lua_pushinteger(l, getPartIndex_curIdx);