Пример #1
0
// set_detach(self)
int ObjectRef::l_set_detach(lua_State *L)
{
	GET_ENV_PTR;

	ObjectRef *ref = checkobject(L, 1);
	ServerActiveObject *co = getobject(ref);
	if (co == NULL)
		return 0;

	co->clearParentAttachment();
	return 0;
}
Пример #2
0
// remove(self)
int ObjectRef::l_remove(lua_State *L)
{
	GET_ENV_PTR;

	ObjectRef *ref = checkobject(L, 1);
	ServerActiveObject *co = getobject(ref);
	if (co == NULL)
		return 0;
	if (co->getType() == ACTIVEOBJECT_TYPE_PLAYER)
		return 0;

	co->clearChildAttachments();
	co->clearParentAttachment();

	verbosestream << "ObjectRef::l_remove(): id=" << co->getId() << std::endl;
	co->m_pending_removal = true;
	return 0;
}