Check player init

This commit is contained in:
Vortrex
2022-03-08 10:30:07 -06:00
parent bc8c19991b
commit 1812043e9c
2 changed files with 39 additions and 23 deletions

View File

@@ -63,7 +63,9 @@ function getGameAreas(gameId) {
*/
function getPlayerData(client) {
if(client != null) {
return getServerData().clients[client.index];
if(isClientInitialized(client)) {
return getServerData().clients[client.index];
}
}
return false;
}
@@ -455,4 +457,10 @@ function updateTimeRule() {
}
}
// ===========================================================================
function isClientInitialized(client) {
return (typeof getServerData().clients[client.index] != "undefined");
}
// ===========================================================================