diff options
author | Weblate <42@minetest.ru> | 2013-04-07 13:39:28 +0200 |
---|---|---|
committer | Weblate <42@minetest.ru> | 2013-04-07 13:39:28 +0200 |
commit | feb7de91ec34ef1ca3152270a7bc62b2e308f1bd (patch) | |
tree | 65c33378bae9b7ac565b979237b6d594b511171f /src/scriptapi_object.cpp | |
parent | 33052abf42886ef03c4f46196cab6f767259a672 (diff) | |
parent | 4468ea84e6d0faede5a01e8d97d359c537aa7ec8 (diff) | |
download | minetest-feb7de91ec34ef1ca3152270a7bc62b2e308f1bd.tar.gz minetest-feb7de91ec34ef1ca3152270a7bc62b2e308f1bd.tar.bz2 minetest-feb7de91ec34ef1ca3152270a7bc62b2e308f1bd.zip |
Merge remote branch 'origin/master'
Diffstat (limited to 'src/scriptapi_object.cpp')
-rw-r--r-- | src/scriptapi_object.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/scriptapi_object.cpp b/src/scriptapi_object.cpp index a0f93cbba..05433a598 100644 --- a/src/scriptapi_object.cpp +++ b/src/scriptapi_object.cpp @@ -297,6 +297,28 @@ int ObjectRef::l_set_armor_groups(lua_State *L) return 0; } +// set_physics_override(self, physics_override_speed, physics_override_jump, physics_override_gravity) +int ObjectRef::l_set_physics_override(lua_State *L) +{ + ObjectRef *ref = checkobject(L, 1); + PlayerSAO *co = (PlayerSAO *) getobject(ref); + if(co == NULL) return 0; + // Do it + if(!lua_isnil(L, 2)){ + co->m_physics_override_speed = lua_tonumber(L, 2); + co->m_physics_override_sent = false; + } + if(!lua_isnil(L, 3)){ + co->m_physics_override_jump = lua_tonumber(L, 3); + co->m_physics_override_sent = false; + } + if(!lua_isnil(L, 4)){ + co->m_physics_override_gravity = lua_tonumber(L, 4); + co->m_physics_override_sent = false; + } + return 0; +} + // set_animation(self, frame_range, frame_speed, frame_blend) int ObjectRef::l_set_animation(lua_State *L) { @@ -756,6 +778,7 @@ const luaL_reg ObjectRef::methods[] = { luamethod(ObjectRef, get_wielded_item), luamethod(ObjectRef, set_wielded_item), luamethod(ObjectRef, set_armor_groups), + luamethod(ObjectRef, set_physics_override), luamethod(ObjectRef, set_animation), luamethod(ObjectRef, set_bone_position), luamethod(ObjectRef, set_attach), |