Skip to content

Commit

Permalink
potential fix in sim.partCreate, also
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Jul 14, 2017
1 parent 7dd538b commit f3a7d96
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lua/LuaScriptInterface.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit f3a7d96

Please sign in to comment.