diff options
author | Kahrl <kahrl@gmx.net> | 2015-02-23 16:48:51 +1000 |
---|---|---|
committer | Craig Robbins <kde.psych@gmail.com> | 2015-02-23 16:49:48 +1000 |
commit | 38cf080a9c2a1e5b9ad41cf62d2eacdc92133d16 (patch) | |
tree | 2043f21323f839162dbbecc1dc5ef50acf894974 /src/script/lua_api/l_object.cpp | |
parent | cd4324e5a800f12d4bbfea07a47d78e04eace920 (diff) | |
download | minetest-38cf080a9c2a1e5b9ad41cf62d2eacdc92133d16.tar.gz minetest-38cf080a9c2a1e5b9ad41cf62d2eacdc92133d16.tar.bz2 minetest-38cf080a9c2a1e5b9ad41cf62d2eacdc92133d16.zip |
Disallow object:remove() if the object is a player
Rebased by Zeno- (conflict in lua_api.txt)
Diffstat (limited to 'src/script/lua_api/l_object.cpp')
-rw-r--r-- | src/script/lua_api/l_object.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index e048d072f..73f6e93b3 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -131,6 +131,7 @@ int ObjectRef::l_remove(lua_State *L) ObjectRef *ref = checkobject(L, 1); ServerActiveObject *co = getobject(ref); if(co == NULL) return 0; + if(co->getType() == ACTIVEOBJECT_TYPE_PLAYER) return 0; verbosestream<<"ObjectRef::l_remove(): id="<<co->getId()<<std::endl; co->m_removed = true; return 0; |