Fix get client from index util, add get console

This commit is contained in:
Vortrex
2021-01-21 04:45:18 -06:00
parent c8c44de1be
commit 25e3d25a34

View File

@@ -186,7 +186,23 @@ function isSamePlayer(client1, client2) {
// ---------------------------------------------------------------------------
function getClientFromIndex(index) {
return getClients().find(c => c.index == index);
let clients = getClients();
for(let i in clients) {
if(clients[i].index == index) {
return clients[i];
}
}
}
// ---------------------------------------------------------------------------
function getConsoleClient() {
let clients = getClients();
for(let i in clients) {
if(isConsole(clients[i])) {
return clients[i];
}
}
}
// ---------------------------------------------------------------------------