diff options
Diffstat (limited to 'src/script/common')
-rw-r--r-- | src/script/common/c_content.cpp | 23 | ||||
-rw-r--r-- | src/script/common/c_content.h | 2 |
2 files changed, 25 insertions, 0 deletions
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"); +} diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h index 5a8bf6700..eeef71c36 100644 --- a/src/script/common/c_content.h +++ b/src/script/common/c_content.h @@ -202,3 +202,5 @@ void push_hud_element (lua_State *L, HudElement *elem); HudElementStat read_hud_change (lua_State *L, HudElement *elem, void **value); void push_collision_move_result(lua_State *L, const collisionMoveResult &res); + +void push_physics_override (lua_State *L, float speed, float jump, float gravity, bool sneak, bool sneak_glitch, bool new_move); |