fix: packet clearing
This commit is contained in:
parent
15a46d3668
commit
4f7b0c74aa
|
@ -128,6 +128,10 @@ export class Vulnerable extends Trait {
|
|||
this._hasAddedEmitterRenderer = true;
|
||||
}
|
||||
|
||||
cleanPackets() {
|
||||
this.damages = [];
|
||||
}
|
||||
|
||||
get isInvulnerable() {
|
||||
return this._isInvulnerable;
|
||||
}
|
||||
|
@ -138,9 +142,7 @@ export class Vulnerable extends Trait {
|
|||
|
||||
packets(informed) {
|
||||
if (this.damages.length > 0) {
|
||||
const {damages} = this;
|
||||
this.damages = [];
|
||||
return new DamagePacket(damages);
|
||||
return new DamagePacket(this.damages);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,10 @@ export class Receptacle extends decorate(Trait) {
|
|||
}
|
||||
}
|
||||
|
||||
cleanPackets() {
|
||||
this.packetUpdates = [];
|
||||
}
|
||||
|
||||
destroy() {
|
||||
for (let i = 0; i < this.entity.slotCount; ++i) {
|
||||
const item = this.entity.removeItemFromSlot(i);
|
||||
|
@ -133,9 +137,7 @@ export class Receptacle extends decorate(Trait) {
|
|||
}
|
||||
|
||||
packets(informed) {
|
||||
const packetsForUpdate = this.packetUpdates;
|
||||
this.packetUpdates = [];
|
||||
return packetsForUpdate;
|
||||
return this.packetUpdates;
|
||||
}
|
||||
|
||||
removeListenersForItem(item) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user