From 77137a92cfc221b885b8eae68f13cede604fcac7 Mon Sep 17 00:00:00 2001 From: Ciaran Gultnieks Date: Mon, 17 Nov 2014 21:17:36 +0000 Subject: [PATCH] Don't corrupt stepheight when setting other properties --- src/script/common/c_content.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index 1972c40e0..bf4da41ec 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -191,8 +191,8 @@ 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); - getfloatfield(L, -1, "stepheight", prop->stepheight); - prop->stepheight*=BS; + if (getfloatfield(L, -1, "stepheight", prop->stepheight)) + prop->stepheight *= BS; lua_getfield(L, -1, "automatic_face_movement_dir"); if (lua_isnumber(L, -1)) { prop->automatic_face_movement_dir = true; -- 2.25.1