From 4e7b7346dcd7b5ee3f0011c0cfb53371b9622da6 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 13 Dec 2018 10:06:46 -0800 Subject: [PATCH] Fix a bug introduced in PR14566, actually fixing MS17811 --- assignment-client/src/avatars/AvatarMixerSlave.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/assignment-client/src/avatars/AvatarMixerSlave.cpp b/assignment-client/src/avatars/AvatarMixerSlave.cpp index 5df7758a0c..cd9d164ef7 100644 --- a/assignment-client/src/avatars/AvatarMixerSlave.cpp +++ b/assignment-client/src/avatars/AvatarMixerSlave.cpp @@ -395,8 +395,14 @@ void AvatarMixerSlave::broadcastAvatarDataToAgent(const SharedNodePointer& node) } // If Avatar A's PAL WAS open but is no longer open, AND - // Avatar A should be ignoring Avatar B... - if (PALWasOpen && !PALIsOpen && shouldIgnore) { + // Avatar A is ignoring Avatar B OR Avatar B is ignoring Avatar A... + // + // This is a bit heavy-handed still - there are cases where a kill packet + // will be sent when it doesn't need to be (but where it _should_ be OK to send). + // However, it's less heavy-handed than using `shouldIgnore`. + if (PALWasOpen && !PALIsOpen && + (destinationNode->isIgnoringNodeWithID(avatarNode->getUUID()) || + avatarNode->isIgnoringNodeWithID(destinationNode->getUUID()))) { // ...send a Kill Packet to Node A, instructing Node A to kill Avatar B, // then have Node A cleanup the killed Node B. auto packet = NLPacket::create(PacketType::KillAvatar, NUM_BYTES_RFC4122_UUID + sizeof(KillAvatarReason), true);