Permalink
Browse files

potential fix in sim.partCreate, also

  • Loading branch information...
jacob1 committed Jul 14, 2017
1 parent 7dd538b commit f3a7d966d28a486e9d8bec4d0156ad634463ccbe
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/lua/LuaScriptInterface.cpp
@@ -898,7 +898,12 @@ int LuaScriptInterface::simulation_partChangeType(lua_State * l)
int LuaScriptInterface::simulation_partCreate(lua_State * l)
{
int newID = lua_tointeger(l, 1);
if(newID >= NPART || newID < -3)
if (newID >= NPART || newID < -3)
{
lua_pushinteger(l, -1);
return 1;
}
if (newID >= 0 && !luacon_sim->parts[newID].type)
{
lua_pushinteger(l, -1);
return 1;

0 comments on commit f3a7d96

Please sign in to comment.