fix queryPacket initialization in Application

This commit is contained in:
Stephen Birarda 2015-07-07 15:40:54 -07:00
parent 03b17cc5dc
commit 11d5aa9803

View file

@ -2804,7 +2804,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType::Value packetTyp
qCDebug(interfaceapp, "perServerPPS: %d perUnknownServer: %d", perServerPPS, perUnknownServer); qCDebug(interfaceapp, "perServerPPS: %d perUnknownServer: %d", perServerPPS, perUnknownServer);
} }
auto queryPacket { NLPacket::create(packetType); } auto queryPacket = NLPacket::create(packetType);
nodeList->eachNode([&](const SharedNodePointer& node){ nodeList->eachNode([&](const SharedNodePointer& node){
// only send to the NodeTypes that are serverType // only send to the NodeTypes that are serverType
@ -2883,7 +2883,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType::Value packetTyp
// encode the query data // encode the query data
int packetSize = _octreeQuery.getBroadcastData(queryPacket.payload()); int packetSize = _octreeQuery.getBroadcastData(queryPacket.payload());
queryPacket.setSizeUsed(packetSize); queryPacket->setSizeUsed(packetSize);
// make sure we still have an active socket // make sure we still have an active socket
nodeList->sendUnreliablePacket(queryPacket, node); nodeList->sendUnreliablePacket(queryPacket, node);