summaryrefslogtreecommitdiff
path: root/src/cat/LegacyLuaAPI.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-01-06 17:25:13 (GMT)
committer jacob1 <jfu614@gmail.com>2013-01-06 17:25:13 (GMT)
commit8e09651990d45d8b25b8795cbd1cfffeecfd3f5f (patch)
tree97bb518a834b3b78e2b995a04eccee6c9fe98f37 /src/cat/LegacyLuaAPI.cpp
parent15040b32b0a829a020118561d5da9d01eb1484ab (diff)
downloadpowder-8e09651990d45d8b25b8795cbd1cfffeecfd3f5f.zip
powder-8e09651990d45d8b25b8795cbd1cfffeecfd3f5f.tar.gz
fix element function replacement option
Diffstat (limited to 'src/cat/LegacyLuaAPI.cpp')
-rw-r--r--src/cat/LegacyLuaAPI.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cat/LegacyLuaAPI.cpp b/src/cat/LegacyLuaAPI.cpp
index 9a478e7..80a7f82 100644
--- a/src/cat/LegacyLuaAPI.cpp
+++ b/src/cat/LegacyLuaAPI.cpp
@@ -648,13 +648,17 @@ int luatpt_element_func(lua_State *l)
if(lua_isfunction(l, 1))
{
int element = luaL_optint(l, 2, 0);
+ int replace = luaL_optint(l, 3, 0);
int function;
lua_pushvalue(l, 1);
function = luaL_ref(l, LUA_REGISTRYINDEX);
if(element > 0 && element < PT_NUM)
{
lua_el_func[element] = function;
- luacon_sim->elements[element].Update = &luacon_elementReplacement;
+ if(replace)
+ lua_el_mode[element] = 2;
+ else
+ lua_el_mode[element] = 1;
return 0;
}
else