Add real v parameter to sim.partCreate
Currently it detects presence of v incorrectly (via if (ID(type))) and thus rewrites v = 0 to v = -1, even if 0 is actually what you want. Especially problematic if you're trying to spawn GOL (so LIFE(ctype=0)).
This commit is contained in:
parent
766ffd4ad6
commit
ae253ebc75
@ -1031,7 +1031,11 @@ int LuaScriptInterface::simulation_partCreate(lua_State * l)
|
|||||||
}
|
}
|
||||||
int type = lua_tointeger(l, 4);
|
int type = lua_tointeger(l, 4);
|
||||||
int v = -1;
|
int v = -1;
|
||||||
if (ID(type))
|
if (lua_gettop(l) >= 5)
|
||||||
|
{
|
||||||
|
v = lua_tointeger(l, 5);
|
||||||
|
}
|
||||||
|
else if (ID(type))
|
||||||
{
|
{
|
||||||
v = ID(type);
|
v = ID(type);
|
||||||
type = TYP(type);
|
type = TYP(type);
|
||||||
|
Reference in New Issue
Block a user