fix: remove last
This commit is contained in:
parent
3631a7f669
commit
29abc9f540
|
@ -81,11 +81,6 @@ export class EntityList extends decorate(class {}) {
|
|||
packets.push(new EntityCreatePacket(entity.toJSON(), entity));
|
||||
}
|
||||
this._entitiesJustAdded = [];
|
||||
for (let i = 0; i < this._entitiesJustRemoved.length; i++) {
|
||||
const entity = this._entitiesJustRemoved[i];
|
||||
packets.push(new EntityRemovePacket({}, entity));
|
||||
}
|
||||
this._entitiesJustRemoved = [];
|
||||
}
|
||||
for (let i = 0; i < this._flatEntities.length; i++) {
|
||||
const entityPackets = this._flatEntities[i].packetsForUpdate(force);
|
||||
|
@ -93,6 +88,13 @@ export class EntityList extends decorate(class {}) {
|
|||
packets.push(entityPackets[j]);
|
||||
}
|
||||
}
|
||||
if (!force) {
|
||||
for (let i = 0; i < this._entitiesJustRemoved.length; i++) {
|
||||
const entity = this._entitiesJustRemoved[i];
|
||||
packets.push(new EntityRemovePacket({}, entity));
|
||||
}
|
||||
this._entitiesJustRemoved = [];
|
||||
}
|
||||
return packets;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user