1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Revert "Detach the player from entities on death." (#5087)

This commit is contained in:
Loïc Blot 2017-01-21 17:30:55 +01:00 committed by GitHub
parent b9c1a758a1
commit bc29e03b59
5 changed files with 14 additions and 16 deletions

View file

@ -710,7 +710,20 @@ int ObjectRef::l_set_detach(lua_State *L)
ServerActiveObject *co = getobject(ref);
if (co == NULL)
return 0;
co->detachFromParent();
int parent_id = 0;
std::string bone = "";
v3f position;
v3f rotation;
co->getAttachment(&parent_id, &bone, &position, &rotation);
ServerActiveObject *parent = NULL;
if (parent_id)
parent = env->getActiveObject(parent_id);
// Do it
co->setAttachment(0, "", v3f(0,0,0), v3f(0,0,0));
if (parent != NULL)
parent->removeAttachmentChild(co->getId());
return 0;
}