Skip to content

Commit

Permalink
Merge pull request #217 from boxmein/getpartindex-fix
Browse files Browse the repository at this point in the history
luatpt_getPartIndex no longer returns a valid particle index when next_getPartIndex is false.
  • Loading branch information
jacob1 committed Jun 18, 2014
2 parents c44e734 + 7ab6a7e commit 25085b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lua/LegacyLuaAPI.cpp
Expand Up @@ -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;
}
Expand All @@ -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);
Expand Down

0 comments on commit 25085b7

Please sign in to comment.