|
@@ -107,9 +107,8 @@ export default class XverseAvatarManager extends EventEmitter {
|
|
|
}
|
|
|
if (t.event && [SyncEventType.Appear, SyncEventType.Reset].includes(t.event.type) || !t.event) {
|
|
|
let d = this.avatars.get(t.userId);
|
|
|
- if (t.playerState.avatarId && (d == null ? void 0 : d.avatarId) !== t.playerState.avatarId && (d = void 0,
|
|
|
- this.removeAvatar(t.userId)),
|
|
|
- d) {
|
|
|
+ t.playerState.avatarId && (d == null ? void 0 : d.avatarId) !== t.playerState.avatarId && (d = void 0,this.removeAvatar(t.userId));
|
|
|
+ if (d) {
|
|
|
if (d.disconnected && d.setConnectionStatus(!1),
|
|
|
(u = t.event) != null && u.id && this._room.actionsHandler.confirmEvent(t.event.id),
|
|
|
t.playerState.nickName && (d == null || d._setNickname(t.playerState.nickName)),
|
|
@@ -212,8 +211,11 @@ export default class XverseAvatarManager extends EventEmitter {
|
|
|
, _ = t === this._room.userId;
|
|
|
let g = this.avatars.get(t);
|
|
|
if (g)
|
|
|
+ {
|
|
|
return Promise.resolve(g);
|
|
|
- if (g = new XverseAvatarManager.subAvatar({
|
|
|
+ }
|
|
|
+
|
|
|
+ g = new XverseAvatarManager.subAvatar({
|
|
|
userId: t,
|
|
|
isHost: r,
|
|
|
isSelf: _,
|
|
@@ -222,9 +224,9 @@ export default class XverseAvatarManager extends EventEmitter {
|
|
|
avatarId: o,
|
|
|
nickname: s,
|
|
|
group: c
|
|
|
- }),
|
|
|
- this.avatars.set(t, g),
|
|
|
- !g.withModel)
|
|
|
+ });
|
|
|
+ this.avatars.set(t, g);
|
|
|
+ if (!g.withModel)
|
|
|
return g.isLoading = !1,
|
|
|
g.avatarLoadedHook(),
|
|
|
this._room.emit("avatarChanged", {
|