mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Clean up playersInInstance
This commit is contained in:
+8
-29
@@ -3737,14 +3737,7 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
var joining = true;
|
var joining = true;
|
||||||
var playersInInstance = this.lastLocation.playerList;
|
var playersInInstance = this.lastLocation.playerList;
|
||||||
for (var i = 0; i < playersInInstance.length; i++) {
|
if (!playersInInstance.includes(ctx.displayName)) {
|
||||||
var player = playersInInstance[i];
|
|
||||||
if (player === ctx.displayName) {
|
|
||||||
joining = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (joining) {
|
|
||||||
var onPlayerJoining = {
|
var onPlayerJoining = {
|
||||||
...ctx,
|
...ctx,
|
||||||
type: 'OnPlayerJoining'
|
type: 'OnPlayerJoining'
|
||||||
@@ -7478,17 +7471,10 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
if (this.isGameRunning &&
|
if (this.isGameRunning &&
|
||||||
this.lastLocation.location === L.tag) {
|
this.lastLocation.location === L.tag) {
|
||||||
var ref = API.cachedUsers.get(API.currentUser.id);
|
var ref = API.currentUser;
|
||||||
if (typeof ref === 'undefined') {
|
|
||||||
ref = API.currentUser;
|
|
||||||
}
|
|
||||||
var playersInInstance = this.lastLocation.playerList;
|
var playersInInstance = this.lastLocation.playerList;
|
||||||
for (var i = 0; i < playersInInstance.length; i++) {
|
if (playersInInstance.includes(ref.displayName)) {
|
||||||
var player = playersInInstance[i];
|
users.push(ref);
|
||||||
if (ref.displayName === player) {
|
|
||||||
users.push(ref);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
var friendsInInstance = this.lastLocation.friendList;
|
var friendsInInstance = this.lastLocation.friendList;
|
||||||
for (var i = 0; i < friendsInInstance.length; i++) {
|
for (var i = 0; i < friendsInInstance.length; i++) {
|
||||||
@@ -8040,17 +8026,10 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
instances[instance.id] = instance;
|
instances[instance.id] = instance;
|
||||||
}
|
}
|
||||||
var ref = API.cachedUsers.get(API.currentUser.id);
|
var ref = API.currentUser;
|
||||||
if (typeof ref === 'undefined') {
|
var playersInInstance = this.lastLocation.playerList;
|
||||||
ref = API.currentUser;
|
if (playersInInstance.includes(ref.displayName)) {
|
||||||
}
|
instance.users.push(ref);
|
||||||
var playerInInstance = this.lastLocation.playerList;
|
|
||||||
for (var i = 0; i < playerInInstance.length; i++) {
|
|
||||||
var player = playerInInstance[i];
|
|
||||||
if (ref.displayName === player) {
|
|
||||||
instance.users.push(ref);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
var friendsInInstance = this.lastLocation.friendList;
|
var friendsInInstance = this.lastLocation.friendList;
|
||||||
for (var i = 0; i < friendsInInstance.length; i++) {
|
for (var i = 0; i < friendsInInstance.length; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user