aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorparamat <paramat@users.noreply.github.com>2017-11-03 19:10:53 +0000
committerparamat <mat.gregory@virginmedia.com>2017-11-06 12:54:00 +0000
commit4c40e0775ca564296a56f72ff3adce50ba925b0c (patch)
tree204f8f52953502ef56fff2f25c4d8f976524a6c8 /src/script
parenta07d2594e3b9372cabbeedc98bb98903137f56b3 (diff)
downloadminetest-4c40e0775ca564296a56f72ff3adce50ba925b0c.tar.gz
minetest-4c40e0775ca564296a56f72ff3adce50ba925b0c.tar.bz2
minetest-4c40e0775ca564296a56f72ff3adce50ba925b0c.zip
Player eye height: Make this a settable player object property
Diffstat (limited to 'src/script')
-rw-r--r--src/script/common/c_content.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index 1bbfac25f..73661a7b6 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -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)