From: Perttu Ahola Date: Sun, 4 Dec 2011 14:25:27 +0000 (+0200) Subject: Delete unknown LuaEntities when punched X-Git-Tag: 0.4.dev-20111209-1~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=008de2fb8f4ed77e06ed499e2af8953df2bd1f43;p=oweals%2Fminetest.git Delete unknown LuaEntities when punched --- diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 770577c56..afe82bdd2 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -1658,8 +1658,11 @@ std::string LuaEntitySAO::getStaticData() void LuaEntitySAO::punch(ServerActiveObject *puncher, float time_from_last_punch) { - if(!m_registered) + if(!m_registered){ + // Delete unknown LuaEntities when punched + m_removed = true; return; + } lua_State *L = m_env->getLua(); scriptapi_luaentity_punch(L, m_id, puncher, time_from_last_punch); }