From 81c2370c8b1a66a279a5ff450c78caf5dfef77bf Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Wed, 2 Oct 2019 19:11:27 +0200 Subject: Attachments: Fix attachments to temporary removed objects (#8989) Does not clear the parent's attachment information when the child is deleted locally. Either it was removed permanently, or just temporary - we don't know, but it's up to the server to send a *detach from child" packet for the parent. --- src/content_sao.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/content_sao.cpp') diff --git a/src/content_sao.cpp b/src/content_sao.cpp index d6baa1580..87e6466a9 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -1107,14 +1107,14 @@ void PlayerSAO::step(float dtime, bool send_recommended) if (!send_recommended) return; - // If the object is attached client-side, don't waste bandwidth sending its - // position or rotation to clients. - if (m_position_not_sent && !isAttached()) { + if (m_position_not_sent) { m_position_not_sent = false; float update_interval = m_env->getSendRecommendedInterval(); v3f pos; - if (isAttached()) // Just in case we ever do send attachment position too - pos = m_env->getActiveObject(m_attachment_parent_id)->getBasePosition(); + // When attached, the position is only sent to clients where the + // parent isn't known + if (isAttached()) + pos = m_last_good_position; else pos = m_base_position; -- cgit v1.2.3