Skip to content

Commit

Permalink
Fix visual slide issue with set_detach, fixes #5620
Browse files Browse the repository at this point in the history
  • Loading branch information
shivajiva101 authored and sfan5 committed Apr 29, 2017
1 parent 3251e44 commit c729543
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/script/lua_api/l_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,11 +726,13 @@ int ObjectRef::l_set_detach(lua_State *L)
v3f rotation;
co->getAttachment(&parent_id, &bone, &position, &rotation);
ServerActiveObject *parent = NULL;
if (parent_id)
if (parent_id) {
parent = env->getActiveObject(parent_id);

co->setAttachment(0, "", position, rotation);
} else {
co->setAttachment(0, "", v3f(0, 0, 0), v3f(0, 0, 0));
}
// Do it
co->setAttachment(0, "", v3f(0,0,0), v3f(0,0,0));
if (parent != NULL)
parent->removeAttachmentChild(co->getId());
return 0;
Expand Down

0 comments on commit c729543

Please sign in to comment.