diff options
author | PilzAdam <pilzadam@minetest.net> | 2013-12-03 18:51:15 +0100 |
---|---|---|
committer | PilzAdam <pilzadam@minetest.net> | 2013-12-03 23:20:00 +0100 |
commit | 15be2659eae6da2c3807713eb6e068d8aa436423 (patch) | |
tree | 8c30131f868ca6a11389c4b0649e1d1980dfb8e6 /src/script | |
parent | d9de9f23d93a9a6fd8deccbbf3fce58aad5751a1 (diff) | |
download | minetest-15be2659eae6da2c3807713eb6e068d8aa436423.tar.gz minetest-15be2659eae6da2c3807713eb6e068d8aa436423.tar.bz2 minetest-15be2659eae6da2c3807713eb6e068d8aa436423.zip |
Add sneak and sneak_glitch to set_physics_override()
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/lua_api/l_object.cpp | 11 | ||||
-rw-r--r-- | src/script/lua_api/l_object.h | 3 |
2 files changed, 12 insertions, 2 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; } diff --git a/src/script/lua_api/l_object.h b/src/script/lua_api/l_object.h index 4b4f5eff7..c8c67f2c5 100644 --- a/src/script/lua_api/l_object.h +++ b/src/script/lua_api/l_object.h @@ -101,7 +101,8 @@ private: // set_armor_groups(self, groups) static int l_set_armor_groups(lua_State *L); - // 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) static int l_set_physics_override(lua_State *L); // set_animation(self, frame_range, frame_speed, frame_blend) |