File tree 2 files changed +2
-0
lines changed
2 files changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -2294,6 +2294,7 @@ This is basically a reference to a C++ `ServerActiveObject`
2294
2294
2295
2295
#### Methods
2296
2296
* `remove()`: remove object (after returning from Lua)
2297
+ * Note: Doesn't work on players, use minetest.kick_player instead
2297
2298
* `getpos()`: returns `{x=num, y=num, z=num}`
2298
2299
* `setpos(pos)`; `pos`=`{x=num, y=num, z=num}`
2299
2300
* `moveto(pos, continuous=false)`: interpolated move
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ int ObjectRef::l_remove(lua_State *L)
131
131
ObjectRef *ref = checkobject (L, 1 );
132
132
ServerActiveObject *co = getobject (ref);
133
133
if (co == NULL ) return 0 ;
134
+ if (co->getType () == ACTIVEOBJECT_TYPE_PLAYER) return 0 ;
134
135
verbosestream<<" ObjectRef::l_remove(): id=" <<co->getId ()<<std::endl;
135
136
co->m_removed = true ;
136
137
return 0 ;
You can’t perform that action at this time.
0 commit comments