team lengths
This commit is contained in:
parent
c90d7afc9d
commit
7be246ab0b
@ -153,10 +153,12 @@ class CombatCryps extends Phaser.Scene {
|
|||||||
this.drawCryps(game);
|
this.drawCryps(game);
|
||||||
this.registry.events.on('changedata', this.updateData, this);
|
this.registry.events.on('changedata', this.updateData, this);
|
||||||
this.registry.set('crypStatusUpdate', false);
|
this.registry.set('crypStatusUpdate', false);
|
||||||
|
this.teams = game.teams.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateData(parent, key, data) {
|
updateData(parent, key, data) {
|
||||||
if (key === 'game' && data) {
|
if (key === 'game' && data) {
|
||||||
|
if (data.teams.length !== this.teams) this.scene.restart(data);
|
||||||
const isAnimating = this.phase === 'animating';
|
const isAnimating = this.phase === 'animating';
|
||||||
this.game = data;
|
this.game = data;
|
||||||
if (isAnimating) return false;
|
if (isAnimating) return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user