diff --git a/assignment-client/src/avatars/AvatarMixer.cpp b/assignment-client/src/avatars/AvatarMixer.cpp index 27eae8619f..0c4b614033 100644 --- a/assignment-client/src/avatars/AvatarMixer.cpp +++ b/assignment-client/src/avatars/AvatarMixer.cpp @@ -150,6 +150,13 @@ void AvatarMixer::optionallyReplicatePacket(ReceivedMessage& message, const Node if (!packet) { // construct an NLPacket to send to the replicant that has the contents of the received packet packet = NLPacket::create(replicatedType, message.getSize()); + + if (message.getType() == PacketType::KillAvatar) { + // this was not a replicated packet originally, we need to prepend the session ID + // for the killed node + packet->write(node->getUUID().toRfc4122()); + } + packet->write(message.getMessage()); } @@ -541,8 +548,6 @@ void AvatarMixer::handleAvatarIdentityPacket(QSharedPointer mes } auto end = usecTimestampNow(); _handleAvatarIdentityPacketElapsedTime += (end - start); - - optionallyReplicatePacket(*message, *senderNode); } void AvatarMixer::handleKillAvatarPacket(QSharedPointer message, SharedNodePointer node) {