Skip to content

Commit

Permalink
An entity may already have been removed if the creator that is differ…
Browse files Browse the repository at this point in the history
…ent of the current owner left the room, don't log an error in this case (closes #274)
  • Loading branch information
vincentfretin committed May 13, 2021
1 parent beb02f0 commit ac93c62
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/networked.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,11 @@ AFRAME.registerComponent('networked', {
if (NAF.entities.hasEntity(this.data.networkId)) {
NAF.connection.broadcastDataGuaranteed('r', syncData);
} else {
NAF.log.error("Removing networked entity that is not in entities array.");
// The entity may already have been removed if the creator (different of the current owner) left the room.
// Don't log an error in this case.
if (!(this.data.creator && NAF.connection.activeDataChannels[this.data.creator] === false)) {
NAF.log.error("Removing networked entity that is not in entities array.");
}
}
}
NAF.entities.forgetEntity(this.data.networkId);
Expand Down

0 comments on commit ac93c62

Please sign in to comment.