aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_object.cpp
diff options
context:
space:
mode:
authorPilzAdam <pilzadam@minetest.net>2013-12-03 18:51:15 +0100
committerPilzAdam <pilzadam@minetest.net>2013-12-03 23:20:00 +0100
commit15be2659eae6da2c3807713eb6e068d8aa436423 (patch)
tree8c30131f868ca6a11389c4b0649e1d1980dfb8e6 /src/script/lua_api/l_object.cpp
parentd9de9f23d93a9a6fd8deccbbf3fce58aad5751a1 (diff)
downloadminetest-15be2659eae6da2c3807713eb6e068d8aa436423.tar.gz
minetest-15be2659eae6da2c3807713eb6e068d8aa436423.tar.bz2
minetest-15be2659eae6da2c3807713eb6e068d8aa436423.zip
Add sneak and sneak_glitch to set_physics_override()
Diffstat (limited to 'src/script/lua_api/l_object.cpp')
-rw-r--r--src/script/lua_api/l_object.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp
index cbcaa40eb..5e1517e46 100644
--- a/src/script/lua_api/l_object.cpp
+++ b/src/script/lua_api/l_object.cpp
@@ -349,7 +349,8 @@ int ObjectRef::l_set_armor_groups(lua_State *L)
return 0;
}
-// set_physics_override(self, physics_override_speed, physics_override_jump, physics_override_gravity)
+// set_physics_override(self, physics_override_speed, physics_override_jump,
+// physics_override_gravity, sneak, sneak_glitch)
int ObjectRef::l_set_physics_override(lua_State *L)
{
ObjectRef *ref = checkobject(L, 1);
@@ -368,6 +369,14 @@ int ObjectRef::l_set_physics_override(lua_State *L)
co->m_physics_override_gravity = lua_tonumber(L, 4);
co->m_physics_override_sent = false;
}
+ if (lua_isboolean(L, 5)) {
+ co->m_physics_override_sneak = lua_toboolean(L, 5);
+ co->m_physics_override_sent = false;
+ }
+ if (lua_isboolean(L, 6)) {
+ co->m_physics_override_sneak_glitch = lua_toboolean(L, 6);
+ co->m_physics_override_sent = false;
+ }
return 0;
}