aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_localplayer.cpp
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2022-08-12 11:17:02 +0200
committerGitHub <noreply@github.com>2022-08-12 10:17:02 +0100
commitc8ee755c05ca4410b9b1e816a9244b3cf303d3fe (patch)
tree25a898cc692ba6a996f32d8248dde153847cd539 /src/script/lua_api/l_localplayer.cpp
parentdf1d215f4823b82f704b06eae0179c5e6c6b97af (diff)
downloadminetest-c8ee755c05ca4410b9b1e816a9244b3cf303d3fe.tar.xz
Physics overrides: Move values to a common struct (#12591)
Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'src/script/lua_api/l_localplayer.cpp')
-rw-r--r--src/script/lua_api/l_localplayer.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/script/lua_api/l_localplayer.cpp b/src/script/lua_api/l_localplayer.cpp
index 2efb976c7..1066beed1 100644
--- a/src/script/lua_api/l_localplayer.cpp
+++ b/src/script/lua_api/l_localplayer.cpp
@@ -157,23 +157,24 @@ int LuaLocalPlayer::l_get_physics_override(lua_State *L)
{
LocalPlayer *player = getobject(L, 1);
+ const auto &phys = player->physics_override;
lua_newtable(L);
- lua_pushnumber(L, player->physics_override_speed);
+ lua_pushnumber(L, phys.speed);
lua_setfield(L, -2, "speed");
- lua_pushnumber(L, player->physics_override_jump);
+ lua_pushnumber(L, phys.jump);
lua_setfield(L, -2, "jump");
- lua_pushnumber(L, player->physics_override_gravity);
+ lua_pushnumber(L, phys.gravity);
lua_setfield(L, -2, "gravity");
- lua_pushboolean(L, player->physics_override_sneak);
+ lua_pushboolean(L, phys.sneak);
lua_setfield(L, -2, "sneak");
- lua_pushboolean(L, player->physics_override_sneak_glitch);
+ lua_pushboolean(L, phys.sneak_glitch);
lua_setfield(L, -2, "sneak_glitch");
- lua_pushboolean(L, player->physics_override_new_move);
+ lua_pushboolean(L, phys.new_move);
lua_setfield(L, -2, "new_move");
return 1;