mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-13 11:54:04 +02:00
potential fix in sim.partCreate, also
This commit is contained in:
@@ -898,7 +898,12 @@ int LuaScriptInterface::simulation_partChangeType(lua_State * l)
|
|||||||
int LuaScriptInterface::simulation_partCreate(lua_State * l)
|
int LuaScriptInterface::simulation_partCreate(lua_State * l)
|
||||||
{
|
{
|
||||||
int newID = lua_tointeger(l, 1);
|
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);
|
lua_pushinteger(l, -1);
|
||||||
return 1;
|
return 1;
|
||||||
|
Reference in New Issue
Block a user