1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Player eye height: Make this a settable player object property

This commit is contained in:
paramat 2017-11-03 19:10:53 +00:00 committed by paramat
parent a07d2594e3
commit 4c40e0775c
7 changed files with 15 additions and 4 deletions

View file

@ -266,6 +266,7 @@ void read_object_properties(lua_State *L, int index,
if (getfloatfield(L, -1, "stepheight", prop->stepheight))
prop->stepheight *= BS;
getboolfield(L, -1, "can_zoom", prop->can_zoom);
getfloatfield(L, -1, "eye_height", prop->eye_height);
getfloatfield(L, -1, "automatic_rotate", prop->automatic_rotate);
lua_getfield(L, -1, "automatic_face_movement_dir");
@ -359,7 +360,8 @@ void push_object_properties(lua_State *L, ObjectProperties *prop)
lua_setfield(L, -2, "stepheight");
lua_pushboolean(L, prop->can_zoom);
lua_setfield(L, -2, "can_zoom");
lua_pushnumber(L, prop->eye_height);
lua_setfield(L, -2, "eye_height");
lua_pushnumber(L, prop->automatic_rotate);
lua_setfield(L, -2, "automatic_rotate");
if (prop->automatic_face_movement_dir)