From 4feea0ac6845ea025e8784f63f48e567d1d24c22 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sun, 18 Aug 2013 15:49:09 +0200 Subject: Add offset to automatic_face_movement_dir --- src/script/common/c_content.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/script/common/c_content.cpp') 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); } /******************************************************************************/ -- cgit v1.2.3