statuses swapping fixes

This commit is contained in:
Piotr 'pwh' Hanusiak
2022-04-19 12:27:39 +02:00
parent 7385ce522f
commit 92c79a89fe
6 changed files with 35 additions and 17 deletions
+4 -2
View File
@@ -139,8 +139,10 @@ export class User implements Movable {
this.voiceIndicatorShown = details.getShowvoiceindicator()?.getValue();
const status = details.getStatus();
if (status !== undefined) {
let sendStatusUpdate = false;
if (status && status !== this.status) {
this.status = status;
sendStatusUpdate = true;
}
const playerDetails = new SetPlayerDetailsMessage();
@@ -151,7 +153,7 @@ export class User implements Movable {
if (this.voiceIndicatorShown !== undefined) {
playerDetails.setShowvoiceindicator(new BoolValue().setValue(this.voiceIndicatorShown));
}
if (details.getStatus() !== undefined) {
if (sendStatusUpdate) {
playerDetails.setStatus(details.getStatus());
}