fix: visible update

This commit is contained in:
cha0s 2019-10-01 18:30:09 -05:00
parent cfd6a5ef67
commit 8105ad2ad3

View File

@ -74,9 +74,9 @@ export class Visible extends decorate(Trait) {
} }
acceptPacket(packet) { acceptPacket(packet) {
if (packet instanceof TraitUpdatedVisiblePacket) { if (packet instanceof TraitUpdateVisiblePacket) {
this.entity.isVisible = packet.data.isVisible; this.entity.isVisible = packet.data.isVisible;
this.entity.opacity = packet.data.opacity / 255; this.entity.opacity = packet.data.opacity;
} }
} }
@ -93,7 +93,7 @@ export class Visible extends decorate(Trait) {
} }
} }
packetsForUpdate() { packets(informed) {
const {isVisible, opacity} = this.stateDifferences(); const {isVisible, opacity} = this.stateDifferences();
if (isVisible || opacity) { if (isVisible || opacity) {
return new TraitUpdateVisiblePacket(this.state); return new TraitUpdateVisiblePacket(this.state);