handle case where user grab data didn't have a heartbeat

This commit is contained in:
Seth Alves 2016-02-23 16:35:20 -08:00
parent 0e028fbac8
commit acd2caf26c

View file

@ -1731,7 +1731,8 @@ function MyController(hand) {
};
Entities.editEntity(entityID, whileHeldProperties);
} else if (data["refCount"] > 1) {
if (now - data["heartBeat"] > HEART_BEAT_TIMEOUT) {
if (data["heartBeat"] === undefined ||
now - data["heartBeat"] > HEART_BEAT_TIMEOUT) {
// this entity has userData suggesting it is grabbed, but nobody is updating the hearbeat.
// deactivate it before grabbing.
this.resetAbandonedGrab(entityID);