aboutsummaryrefslogtreecommitdiff
path: root/src/script/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/common')
-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);
}
/******************************************************************************/