From 82216e1476dff509ba0c83bfabf5e4ec6e1075b2 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Mon, 23 Nov 2020 19:10:56 +0100 Subject: LocalPlayer:set_physics_override; minetest.register_on_recieve_physics_override --- src/script/common/c_content.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/script/common/c_content.cpp') diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index 210363417..78c46f0e0 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -2096,3 +2096,26 @@ void push_collision_move_result(lua_State *L, const collisionMoveResult &res) lua_setfield(L, -2, "collisions"); /**/ } + +void push_physics_override(lua_State *L, float speed, float jump, float gravity, bool sneak, bool sneak_glitch, bool new_move) +{ + lua_createtable(L, 0, 6); + + lua_pushnumber(L, speed); + lua_setfield(L, -2, "speed"); + + lua_pushnumber(L, jump); + lua_setfield(L, -2, "jump"); + + lua_pushnumber(L, gravity); + lua_setfield(L, -2, "gravity"); + + lua_pushboolean(L, sneak); + lua_setfield(L, -2, "sneak"); + + lua_pushboolean(L, sneak_glitch); + lua_setfield(L, -2, "sneak_glitch"); + + lua_pushboolean(L, new_move); + lua_setfield(L, -2, "new_move"); +} -- cgit v1.2.3