fix OctreeSceneStat unpacking in Application

This commit is contained in:
Stephen Birarda 2015-07-27 09:53:27 -07:00
parent a9d5723eb3
commit 9c57d1544f

View file

@ -3596,19 +3596,13 @@ int Application::processOctreeStats(NLPacket& packet, SharedNodePointer sendingN
int statsMessageLength = 0; int statsMessageLength = 0;
const QUuid& nodeUUID = sendingNode->getUUID(); const QUuid& nodeUUID = sendingNode->getUUID();
OctreeSceneStats* octreeStats;
// now that we know the node ID, let's add these stats to the stats for that node... // now that we know the node ID, let's add these stats to the stats for that node...
_octreeSceneStatsLock.lockForWrite(); _octreeSceneStatsLock.lockForWrite();
auto it = _octreeServerSceneStats.find(nodeUUID);
if (it != _octreeServerSceneStats.end()) { OctreeSceneStats* octreeStats = &_octreeServerSceneStats[nodeUUID];
octreeStats = &it->second; statsMessageLength = octreeStats->unpackFromPacket(packet);
statsMessageLength = octreeStats->unpackFromPacket(packet);
} else {
OctreeSceneStats temp;
statsMessageLength = temp.unpackFromPacket(packet);
octreeStats = &temp;
}
_octreeSceneStatsLock.unlock(); _octreeSceneStatsLock.unlock();
VoxelPositionSize rootDetails; VoxelPositionSize rootDetails;