View orange status users in current instance, remove dupes 2

This commit is contained in:
Natsumi
2021-03-20 15:13:09 +13:00
parent 8de3e0cf8e
commit dae546f324

View File

@@ -7990,15 +7990,25 @@ speechSynthesis.getVoices();
instance.users.push((typeof ref === 'undefined')
? API.currentUser
: ref);
var playersInInstance = this.lastLocation.friendList;
for (var i = 0; i < playersInInstance.length; i++) {
var player = playersInInstance[i];
for (var ref of API.cachedUsers.values()) {
if (ref.displayName === player) {
instance.users.push(ref);
var friendsInInstance = this.lastLocation.friendList;
for (var i = 0; i < friendsInInstance.length; i++) {
var addUser = true;
var player = friendsInInstance[i];
for (var k = 0; k < instance.users.length; k++) {
var user = instance.users[k];
if (user.displayName === player) {
addUser = false;
break;
}
}
if (addUser) {
for (var ref of API.cachedUsers.values()) {
if (ref.displayName === player) {
instance.users.push(ref);
break;
}
}
}
}
}
}