summaryrefslogtreecommitdiff
path: root/src/cat/LuaScriptInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cat/LuaScriptInterface.cpp')
-rw-r--r--src/cat/LuaScriptInterface.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp
index c7dc15d..48e7908 100644
--- a/src/cat/LuaScriptInterface.cpp
+++ b/src/cat/LuaScriptInterface.cpp
@@ -1128,8 +1128,13 @@ int luatpt_reset_spark(lua_State* l)
{
if (luacon_sim->parts[i].type==PT_SPRK)
{
- luacon_sim->parts[i].type = luacon_sim->parts[i].ctype;
- luacon_sim->parts[i].life = 4;
+ if (luacon_sim->parts[i].ctype >= 0 && luacon_sim->parts[i].ctype < PT_NUM)
+ {
+ luacon_sim->parts[i].type = luacon_sim->parts[i].ctype;
+ luacon_sim->parts[i].life = 0;
+ }
+ else
+ luacon_sim->kill_part(i);
}
}
return 0;