mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
don't move the re-used mute environment packet
This commit is contained in:
parent
cd56d635e1
commit
26abca92ae
1 changed files with 14 additions and 5 deletions
|
@ -553,15 +553,24 @@ void AudioMixer::handleMuteEnvironmentPacket(QSharedPointer<ReceivedMessage> mes
|
|||
|
||||
if (sendingNode->isAllowedEditor()) {
|
||||
qDebug() << "Received a mute environment packet of" << message->getSize() << "bytes";
|
||||
|
||||
auto newPacket = NLPacket::create(PacketType::MuteEnvironment, message->getSize());
|
||||
// Copy payload
|
||||
newPacket->write(message->getRawMessage(), message->getSize());
|
||||
|
||||
glm::vec3 position;
|
||||
float radius;
|
||||
|
||||
auto newPacket = NLPacket::create(PacketType::MuteEnvironment, sizeof(position) + sizeof(radius));
|
||||
|
||||
// read the position and radius from the sent packet
|
||||
message->readPrimitive(&position);
|
||||
message->readPrimitive(&radius);
|
||||
|
||||
// write them to our packet
|
||||
newPacket->writePrimitive(position);
|
||||
newPacket->writePrimitive(radius);
|
||||
|
||||
nodeList->eachNode([&](const SharedNodePointer& node){
|
||||
if (node->getType() == NodeType::Agent && node->getActiveSocket() &&
|
||||
node->getLinkedData() && node != sendingNode) {
|
||||
nodeList->sendPacket(std::move(newPacket), *node);
|
||||
nodeList->sendUnreliablePacket(*newPacket, *node);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue