round-remote-socket
Thibault Duplessis 2019-11-08 09:19:57 -06:00
parent 41d59c5346
commit e1420c0056
1 changed files with 2 additions and 2 deletions

View File

@ -108,14 +108,14 @@ export function isCorrespondence(data: GameData): boolean {
}
export function setOnGame(data: GameData, color: Color, onGame: boolean): void {
var player = getPlayer(data, color);
const player = getPlayer(data, color);
onGame = onGame || !!player.ai;
player.onGame = onGame;
if (onGame) setIsGone(data, color, false);
}
export function setIsGone(data: GameData, color: Color, isGone: boolean): void {
var player = getPlayer(data, color);
const player = getPlayer(data, color);
isGone = isGone && !player.ai;
player.isGone = isGone;
if (!isGone && player.user) player.user.online = true;