mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 06:10:52 +02:00
Merge pull request #810 from ZappoMan/master
quick fix crash in parseVoxelStats()
This commit is contained in:
commit
96e6c2f9bd
1 changed files with 18 additions and 15 deletions
|
@ -3962,24 +3962,27 @@ int Application::parseVoxelStats(unsigned char* messageData, ssize_t messageLeng
|
||||||
|
|
||||||
// But, also identify the sender, and keep track of the contained jurisdiction root for this server
|
// But, also identify the sender, and keep track of the contained jurisdiction root for this server
|
||||||
Node* voxelServer = NodeList::getInstance()->nodeWithAddress(&senderAddress);
|
Node* voxelServer = NodeList::getInstance()->nodeWithAddress(&senderAddress);
|
||||||
uint16_t nodeID = voxelServer->getNodeID();
|
|
||||||
|
|
||||||
VoxelPositionSize jurisditionDetails;
|
|
||||||
voxelDetailsForCode(_voxelSceneStats.getJurisdictionRoot(), jurisditionDetails);
|
|
||||||
|
|
||||||
// see if this is the first we've heard of this node...
|
// quick fix for crash... why would voxelServer be NULL?
|
||||||
if (_voxelServerJurisdictions.find(nodeID) == _voxelServerJurisdictions.end()) {
|
if (voxelServer) {
|
||||||
printf("stats from new voxel server... v[%f, %f, %f, %f]\n",
|
uint16_t nodeID = voxelServer->getNodeID();
|
||||||
jurisditionDetails.x, jurisditionDetails.y, jurisditionDetails.z, jurisditionDetails.s);
|
|
||||||
|
|
||||||
// Add the jurisditionDetails object to the list of "fade outs"
|
VoxelPositionSize jurisditionDetails;
|
||||||
VoxelFade fade(VoxelFade::FADE_OUT, NODE_ADDED_RED, NODE_ADDED_GREEN, NODE_ADDED_BLUE);
|
voxelDetailsForCode(_voxelSceneStats.getJurisdictionRoot(), jurisditionDetails);
|
||||||
fade.voxelDetails = jurisditionDetails;
|
|
||||||
_voxelFades.push_back(fade);
|
// see if this is the first we've heard of this node...
|
||||||
|
if (_voxelServerJurisdictions.find(nodeID) == _voxelServerJurisdictions.end()) {
|
||||||
|
printf("stats from new voxel server... v[%f, %f, %f, %f]\n",
|
||||||
|
jurisditionDetails.x, jurisditionDetails.y, jurisditionDetails.z, jurisditionDetails.s);
|
||||||
|
|
||||||
|
// Add the jurisditionDetails object to the list of "fade outs"
|
||||||
|
VoxelFade fade(VoxelFade::FADE_OUT, NODE_ADDED_RED, NODE_ADDED_GREEN, NODE_ADDED_BLUE);
|
||||||
|
fade.voxelDetails = jurisditionDetails;
|
||||||
|
_voxelFades.push_back(fade);
|
||||||
|
}
|
||||||
|
// store jurisdiction details for later use
|
||||||
|
_voxelServerJurisdictions[nodeID] = jurisditionDetails;
|
||||||
}
|
}
|
||||||
// store jurisdiction details for later use
|
|
||||||
_voxelServerJurisdictions[nodeID] = jurisditionDetails;
|
|
||||||
|
|
||||||
return statsMessageLength;
|
return statsMessageLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue