1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add offset to automatic_face_movement_dir

This commit is contained in:
PilzAdam 2013-08-18 15:49:09 +02:00
parent 681e136d5f
commit 4feea0ac68
7 changed files with 24 additions and 8 deletions

View file

@ -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);
}
/******************************************************************************/