aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-12-04 16:25:27 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-12-04 16:25:27 +0200
commit008de2fb8f4ed77e06ed499e2af8953df2bd1f43 (patch)
tree8fa1c733a46b85699fb3d5cef8772025cda1eb0a /src
parent2e67fa3e4841adf85f832d6358de53985de6f12c (diff)
downloadminetest-008de2fb8f4ed77e06ed499e2af8953df2bd1f43.tar.gz
minetest-008de2fb8f4ed77e06ed499e2af8953df2bd1f43.tar.bz2
minetest-008de2fb8f4ed77e06ed499e2af8953df2bd1f43.zip
Delete unknown LuaEntities when punched
Diffstat (limited to 'src')
-rw-r--r--src/content_sao.cpp5
1 files changed, 4 insertions, 1 deletions
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);
}