Skip to content

Commit c729543

Browse files
shivajiva101sfan5
authored andcommittedApr 29, 2017
Fix visual slide issue with set_detach, fixes #5620
1 parent 3251e44 commit c729543

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎src/script/lua_api/l_object.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -726,11 +726,13 @@ int ObjectRef::l_set_detach(lua_State *L)
726726
v3f rotation;
727727
co->getAttachment(&parent_id, &bone, &position, &rotation);
728728
ServerActiveObject *parent = NULL;
729-
if (parent_id)
729+
if (parent_id) {
730730
parent = env->getActiveObject(parent_id);
731-
731+
co->setAttachment(0, "", position, rotation);
732+
} else {
733+
co->setAttachment(0, "", v3f(0, 0, 0), v3f(0, 0, 0));
734+
}
732735
// Do it
733-
co->setAttachment(0, "", v3f(0,0,0), v3f(0,0,0));
734736
if (parent != NULL)
735737
parent->removeAttachmentChild(co->getId());
736738
return 0;

0 commit comments

Comments
 (0)
Please sign in to comment.