Check player init
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user