summaryrefslogtreecommitdiff
path: root/src/content_sao.cpp
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-10-02 19:11:27 +0200
committerGitHub <noreply@github.com>2019-10-02 19:11:27 +0200
commit81c2370c8b1a66a279a5ff450c78caf5dfef77bf (patch)
treedafd49bfa912783985b5a58713805027f06322b4 /src/content_sao.cpp
parent251038e136f22f29999bd938e6c9e9f1a5269243 (diff)
downloadminetest-81c2370c8b1a66a279a5ff450c78caf5dfef77bf.tar.gz
minetest-81c2370c8b1a66a279a5ff450c78caf5dfef77bf.tar.bz2
minetest-81c2370c8b1a66a279a5ff450c78caf5dfef77bf.zip
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.
Diffstat (limited to 'src/content_sao.cpp')
-rw-r--r--src/content_sao.cpp10
1 files changed, 5 insertions, 5 deletions
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;