team lengths

This commit is contained in:
Mashy 2019-03-29 20:41:27 +10:00
parent c90d7afc9d
commit 7be246ab0b

View File

@ -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;