summaryrefslogtreecommitdiff
path: root/src/script/common
diff options
context:
space:
mode:
authorparamat <paramat@users.noreply.github.com>2017-08-28 22:46:12 +0100
committerparamat <mat.gregory@virginmedia.com>2017-08-30 19:39:05 +0100
commit561a01cc2a8ca0b83b37975a048d34dcfd0d41e1 (patch)
treeeed4bfe89f439e4c0573b76e0c670ff0267c1cdc /src/script/common
parentbd6b90359c654f4c75964755e476a8bfd90114ba (diff)
downloadminetest-561a01cc2a8ca0b83b37975a048d34dcfd0d41e1.tar.gz
minetest-561a01cc2a8ca0b83b37975a048d34dcfd0d41e1.tar.bz2
minetest-561a01cc2a8ca0b83b37975a048d34dcfd0d41e1.zip
Zoom: Move enabling zoom to a new player object property
Default enabled for no change in default behaviour. Remove 'zoom' privilege.
Diffstat (limited to 'src/script/common')
-rw-r--r--src/script/common/c_content.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index f746ce766..3932321a7 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -260,9 +260,11 @@ void read_object_properties(lua_State *L, int index,
getboolfield(L, -1, "is_visible", prop->is_visible);
getboolfield(L, -1, "makes_footstep_sound", prop->makes_footstep_sound);
- getfloatfield(L, -1, "automatic_rotate", prop->automatic_rotate);
if (getfloatfield(L, -1, "stepheight", prop->stepheight))
prop->stepheight *= BS;
+ getboolfield(L, -1, "can_zoom", prop->can_zoom);
+
+ getfloatfield(L, -1, "automatic_rotate", prop->automatic_rotate);
lua_getfield(L, -1, "automatic_face_movement_dir");
if (lua_isnumber(L, -1)) {
prop->automatic_face_movement_dir = true;
@@ -344,10 +346,13 @@ void push_object_properties(lua_State *L, ObjectProperties *prop)
lua_setfield(L, -2, "is_visible");
lua_pushboolean(L, prop->makes_footstep_sound);
lua_setfield(L, -2, "makes_footstep_sound");
- lua_pushnumber(L, prop->automatic_rotate);
- lua_setfield(L, -2, "automatic_rotate");
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->automatic_rotate);
+ lua_setfield(L, -2, "automatic_rotate");
if (prop->automatic_face_movement_dir)
lua_pushnumber(L, prop->automatic_face_movement_dir_offset);
else