aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorPilzAdam <pilzadam@minetest.net>2013-08-18 15:49:09 +0200
committerPilzAdam <pilzadam@minetest.net>2013-09-10 23:31:44 +0200
commit4feea0ac6845ea025e8784f63f48e567d1d24c22 (patch)
tree2b435201e2198d87ed37210b6e332f2ae4cc597a /src/script
parent681e136d5f8a6847a356f2ef53c4c28123a4cbae (diff)
downloadminetest-4feea0ac6845ea025e8784f63f48e567d1d24c22.tar.gz
minetest-4feea0ac6845ea025e8784f63f48e567d1d24c22.tar.bz2
minetest-4feea0ac6845ea025e8784f63f48e567d1d24c22.zip
Add offset to automatic_face_movement_dir
Diffstat (limited to 'src/script')
-rw-r--r--src/script/common/c_content.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index 3a3a70860..a035b32a2 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -191,7 +191,15 @@ void read_object_properties(lua_State *L, int index,
getfloatfield(L, -1, "automatic_rotate", prop->automatic_rotate);
getfloatfield(L, -1, "stepheight", prop->stepheight);
prop->stepheight*=BS;
- getboolfield(L, -1, "automatic_face_movement_dir", prop->automatic_face_movement_dir);
+ lua_getfield(L, -1, "automatic_face_movement_dir");
+ if (lua_isnumber(L, -1)) {
+ prop->automatic_face_movement_dir = true;
+ prop->automatic_face_movement_dir_offset = luaL_checknumber(L, -1);
+ } else if (lua_isboolean(L, -1)) {
+ prop->automatic_face_movement_dir = lua_toboolean(L, -1);
+ prop->automatic_face_movement_dir_offset = 0.0;
+ }
+ lua_pop(L, 1);
}
/******************************************************************************/