From: Perttu Ahola Date: Sun, 8 Apr 2012 20:13:27 +0000 (+0300) Subject: Fix crash after 'LuaEntity name "particles:smoke" not defined' and similar errors X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=c59d139eebf06680bb4ea019b9a952c20e334154;p=zefram%2Fminetest%2Fminetest_engine.git Fix crash after 'LuaEntity name "particles:smoke" not defined' and similar errors --- diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 2b3f7c02..205621d7 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -389,10 +389,9 @@ void LuaEntitySAO::addedToEnvironment() scriptapi_luaentity_get_properties(L, m_id, &m_prop); // Initialize HP from properties m_hp = m_prop.hp_max; + // Activate entity, supplying serialized state + scriptapi_luaentity_activate(L, m_id, m_init_state.c_str()); } - - // Activate entity, supplying serialized state - scriptapi_luaentity_activate(L, m_id, m_init_state.c_str()); } ServerActiveObject* LuaEntitySAO::create(ServerEnvironment *env, v3f pos,