reduce code
This commit is contained in:
parent
7a163e10ab
commit
7e0bb8357d
1 changed files with 1 additions and 2 deletions
|
|
@ -78,11 +78,10 @@ async function createGame(gameId, targetTiles, image, ts, scoreMode) {
|
|||
|
||||
function addPlayer(gameId, playerId, ts) {
|
||||
const idx = GameCommon.getPlayerIndexById(gameId, playerId)
|
||||
if (idx === -1) {
|
||||
const diff = ts - GameCommon.getStartTs(gameId)
|
||||
if (idx === -1) {
|
||||
GameLog.log(gameId, Protocol.LOG_ADD_PLAYER, playerId, diff)
|
||||
} else {
|
||||
const diff = ts - GameCommon.getStartTs(gameId)
|
||||
GameLog.log(gameId, Protocol.LOG_UPDATE_PLAYER, idx, diff)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue