mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
New physics overrides (#11465)
This commit is contained in:
parent
2479d51cc6
commit
8ebaf753d3
8 changed files with 148 additions and 22 deletions
|
@ -177,6 +177,27 @@ int LuaLocalPlayer::l_get_physics_override(lua_State *L)
|
|||
lua_pushboolean(L, phys.new_move);
|
||||
lua_setfield(L, -2, "new_move");
|
||||
|
||||
lua_pushnumber(L, phys.speed_climb);
|
||||
lua_setfield(L, -2, "speed_climb");
|
||||
|
||||
lua_pushnumber(L, phys.speed_crouch);
|
||||
lua_setfield(L, -2, "speed_crouch");
|
||||
|
||||
lua_pushnumber(L, phys.liquid_fluidity);
|
||||
lua_setfield(L, -2, "liquid_fluidity");
|
||||
|
||||
lua_pushnumber(L, phys.liquid_fluidity_smooth);
|
||||
lua_setfield(L, -2, "liquid_fluidity_smooth");
|
||||
|
||||
lua_pushnumber(L, phys.liquid_sink);
|
||||
lua_setfield(L, -2, "liquid_sink");
|
||||
|
||||
lua_pushnumber(L, phys.acceleration_default);
|
||||
lua_setfield(L, -2, "acceleration_default");
|
||||
|
||||
lua_pushnumber(L, phys.acceleration_air);
|
||||
lua_setfield(L, -2, "acceleration_air");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -1435,6 +1435,13 @@ int ObjectRef::l_set_physics_override(lua_State *L)
|
|||
modified |= getboolfield(L, 2, "sneak", phys.sneak);
|
||||
modified |= getboolfield(L, 2, "sneak_glitch", phys.sneak_glitch);
|
||||
modified |= getboolfield(L, 2, "new_move", phys.new_move);
|
||||
modified |= getfloatfield(L, 2, "speed_climb", phys.speed_climb);
|
||||
modified |= getfloatfield(L, 2, "speed_crouch", phys.speed_crouch);
|
||||
modified |= getfloatfield(L, 2, "liquid_fluidity", phys.liquid_fluidity);
|
||||
modified |= getfloatfield(L, 2, "liquid_fluidity_smooth", phys.liquid_fluidity_smooth);
|
||||
modified |= getfloatfield(L, 2, "liquid_sink", phys.liquid_sink);
|
||||
modified |= getfloatfield(L, 2, "acceleration_default", phys.acceleration_default);
|
||||
modified |= getfloatfield(L, 2, "acceleration_air", phys.acceleration_air);
|
||||
if (modified)
|
||||
playersao->m_physics_override_sent = false;
|
||||
} else {
|
||||
|
@ -1481,6 +1488,20 @@ int ObjectRef::l_get_physics_override(lua_State *L)
|
|||
lua_setfield(L, -2, "sneak_glitch");
|
||||
lua_pushboolean(L, phys.new_move);
|
||||
lua_setfield(L, -2, "new_move");
|
||||
lua_pushnumber(L, phys.speed_climb);
|
||||
lua_setfield(L, -2, "speed_climb");
|
||||
lua_pushnumber(L, phys.speed_crouch);
|
||||
lua_setfield(L, -2, "speed_crouch");
|
||||
lua_pushnumber(L, phys.liquid_fluidity);
|
||||
lua_setfield(L, -2, "liquid_fluidity");
|
||||
lua_pushnumber(L, phys.liquid_fluidity_smooth);
|
||||
lua_setfield(L, -2, "liquid_fluidity_smooth");
|
||||
lua_pushnumber(L, phys.liquid_sink);
|
||||
lua_setfield(L, -2, "liquid_sink");
|
||||
lua_pushnumber(L, phys.acceleration_default);
|
||||
lua_setfield(L, -2, "acceleration_default");
|
||||
lua_pushnumber(L, phys.acceleration_air);
|
||||
lua_setfield(L, -2, "acceleration_air");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue