From 7be246ab0bdf1ed0f02250a02e6accc154a5c2ad Mon Sep 17 00:00:00 2001 From: Mashy Date: Fri, 29 Mar 2019 20:41:27 +1000 Subject: [PATCH] team lengths --- client/src/scenes/combat.cryps.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/src/scenes/combat.cryps.js b/client/src/scenes/combat.cryps.js index 192428c0..9112d2ad 100644 --- a/client/src/scenes/combat.cryps.js +++ b/client/src/scenes/combat.cryps.js @@ -153,10 +153,12 @@ class CombatCryps extends Phaser.Scene { this.drawCryps(game); this.registry.events.on('changedata', this.updateData, this); this.registry.set('crypStatusUpdate', false); + this.teams = game.teams.length; } updateData(parent, key, data) { if (key === 'game' && data) { + if (data.teams.length !== this.teams) this.scene.restart(data); const isAnimating = this.phase === 'animating'; this.game = data; if (isAnimating) return false;