diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index d1cb9d4e4a..9e3b69854f 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1073,7 +1073,9 @@ void DomainServer::sendHeartbeatToDataServer(const QString& networkAddress) { // TODO: have data-web respond with ice-server hostname to use void DomainServer::sendHeartbeatToIceServer() { - DependencyManager::get()->sendHeartbeatToIceServer(_iceServerSocket); + if (!_iceServerSocket.getAddress().isNull()) { + DependencyManager::get()->sendHeartbeatToIceServer(_iceServerSocket); + } } void DomainServer::processNodeJSONStatsPacket(QSharedPointer packetList, SharedNodePointer sendingNode) { diff --git a/examples/attachedEntitiesManager.js b/examples/attachedEntitiesManager.js index 7172b456be..4dda76f4df 100644 --- a/examples/attachedEntitiesManager.js +++ b/examples/attachedEntitiesManager.js @@ -144,9 +144,9 @@ function AttachedEntitiesManager() { this.handleEntityRelease = function(grabbedEntity, releasedFromJoint) { // if this is still equipped, just rewrite the position information. - var grabData = getEntityCustomData('grabKey', entityID, {}); + var grabData = getEntityCustomData('grabKey', grabbedEntity, {}); if ("refCount" in grabData && grabData.refCount > 0) { - manager.updateRelativeOffsets(parsedMessage.grabbedEntity); + manager.updateRelativeOffsets(grabbedEntity); return; } @@ -185,8 +185,8 @@ function AttachedEntitiesManager() { parentJointIndex: bestJointIndex }; - if (bestJointOffset && bestJointOffset.constructor === Array && bestJointOffset.length > 1) { - if (this.avatarIsInDressingRoom()) { + if (bestJointOffset && bestJointOffset.constructor === Array) { + if (this.avatarIsInDressingRoom() || bestJointOffset.length < 2) { this.updateRelativeOffsets(grabbedEntity); } else { // don't snap the entity to the preferred position if the avatar is in the dressing room. diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index e2f88ccb3b..908337f643 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -855,6 +855,7 @@ function MyController(hand) { getEntityCustomData(GRABBABLE_DATA_KEY, candidateEntities[i], DEFAULT_GRABBABLE_DATA); var grabDataForCandidate = getEntityCustomData(GRAB_USER_DATA_KEY, candidateEntities[i], {}); var propsForCandidate = Entities.getEntityProperties(candidateEntities[i], GRABBABLE_PROPERTIES); + var near = (nearPickedCandidateEntities.indexOf(candidateEntities[i]) >= 0); var isPhysical = this.propsArePhysical(propsForCandidate); var grabbable; @@ -916,7 +917,7 @@ function MyController(hand) { continue; } - if (this.state == STATE_SEARCHING && !isPhysical && distance > NEAR_PICK_MAX_DISTANCE) { + if (this.state == STATE_SEARCHING && !isPhysical && distance > NEAR_PICK_MAX_DISTANCE && !near) { // we can't distance-grab non-physical if (WANT_DEBUG_SEARCH_NAME && propsForCandidate.name == WANT_DEBUG_SEARCH_NAME) { print("grab is skipping '" + WANT_DEBUG_SEARCH_NAME + "': not physical and too far for near-grab"); diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index 67237ee269..a3707d19ba 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -671,7 +671,7 @@ const int NUM_BYTES_STUN_HEADER = 20; void LimitedNodeList::sendSTUNRequest() { - if (!_stunSockAddr.isNull()) { + if (!_stunSockAddr.getAddress().isNull()) { const int NUM_INITIAL_STUN_REQUESTS_BEFORE_FAIL = 10; if (!_hasCompletedInitialSTUN) { @@ -840,7 +840,7 @@ void LimitedNodeList::startSTUNPublicSocketUpdate() { } void LimitedNodeList::possiblyTimeoutSTUNAddressLookup() { - if (_stunSockAddr.isNull()) { + if (_stunSockAddr.getAddress().isNull()) { // our stun address is still NULL, but we've been waiting for long enough - time to force a fail stopInitialSTUNUpdate(false); }