diff options
author | paramat <paramat@users.noreply.github.com> | 2017-11-20 01:45:57 +0000 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-12-04 02:25:10 +0000 |
commit | f470cb7270560a26afff0a0eadfc69070236c109 (patch) | |
tree | 045b3cac767dfae7fffc02258d02cbaf7978a96f /src/script/common | |
parent | 2507d32afe05c73bb27ed221c2a592b0894fdc68 (diff) | |
download | minetest-f470cb7270560a26afff0a0eadfc69070236c109.tar.gz minetest-f470cb7270560a26afff0a0eadfc69070236c109.tar.bz2 minetest-f470cb7270560a26afff0a0eadfc69070236c109.zip |
Zoom: Set zoom FOV per-player using a player object property
Remove player object property 'can zoom'.
Add player object property 'zoom fov'.
Remove clientside setting for 'zoom fov'.
Object property default is 15 degrees in creative mode, zoom disabled
in survival mode.
Needed due to zoom now loading and/or generating distant world
according to zoom FOV.
Update object properties serialisation version to 3.
Diffstat (limited to 'src/script/common')
-rw-r--r-- | src/script/common/c_content.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index a9ff1be44..af54a8b31 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -265,7 +265,6 @@ void read_object_properties(lua_State *L, int index, getboolfield(L, -1, "makes_footstep_sound", prop->makes_footstep_sound); 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); @@ -303,6 +302,8 @@ void read_object_properties(lua_State *L, int index, if (!lua_isnil(L, -1)) prop->wield_item = read_item(L, -1, idef).getItemString(); lua_pop(L, 1); + + getfloatfield(L, -1, "zoom_fov", prop->zoom_fov); } /******************************************************************************/ @@ -358,8 +359,6 @@ void push_object_properties(lua_State *L, ObjectProperties *prop) lua_setfield(L, -2, "makes_footstep_sound"); lua_pushnumber(L, prop->stepheight / BS); 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); @@ -385,6 +384,8 @@ void push_object_properties(lua_State *L, ObjectProperties *prop) lua_setfield(L, -2, "static_save"); lua_pushlstring(L, prop->wield_item.c_str(), prop->wield_item.size()); lua_setfield(L, -2, "wield_item"); + lua_pushnumber(L, prop->zoom_fov); + lua_setfield(L, -2, "zoom_fov"); } /******************************************************************************/ |