mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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.
This commit is contained in:
parent
2507d32afe
commit
f470cb7270
12 changed files with 37 additions and 35 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue