mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-26 01:23:37 +02:00
Merge pull request #217 from boxmein/getpartindex-fix
luatpt_getPartIndex no longer returns a valid particle index when next_getPartIndex is false.
This commit is contained in:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user