diff --git a/server/traits/informed.trait.js b/server/traits/informed.trait.js index 6665490..8c223ab 100644 --- a/server/traits/informed.trait.js +++ b/server/traits/informed.trait.js @@ -159,10 +159,17 @@ export class Informed extends decorate(Trait) { } injectEntityRemovePackets(packets, visibleEntities) { + const alreadyRemovedEntities = packets.filter((packet) => { + return packet instanceof EntityRemovePacket; + }).map((packet) => { + return packet.entity; + }); for (let i = 0; i < this.seenEntities.length; i++) { const entity = this.seenEntities[i]; if (-1 === visibleEntities.indexOf(entity)) { - packets.push(new EntityRemovePacket({}, entity)); + if (-1 === alreadyRemovedEntities.indexOf(entity)) { + packets.push(new EntityRemovePacket({}, entity)); + } } } return packets;