fix: conditional visible entity removal

This commit is contained in:
cha0s 2021-02-04 20:25:46 -06:00
parent 22e8d7f45f
commit 6c78ba9cb4

View File

@ -137,6 +137,9 @@ export default (latus) => class EntityList extends decorate(JsonResource) {
if (-1 === index) {
packets.push(entity.createPacket(informed));
}
else {
previousVisibleEntities.splice(index, 1);
}
const entityPackets = entity.packets(informed);
if (entityPackets.length > 0) {
updates.push({
@ -144,7 +147,6 @@ export default (latus) => class EntityList extends decorate(JsonResource) {
packets: entityPackets,
});
}
previousVisibleEntities.splice(index, 1);
}
// Send updates.
this.#informedEntities.set(informed, visibleEntities);