Move to lobby if regathering fixes #31

This commit is contained in:
Chris Blanchard 2015-10-01 11:31:29 +01:00
parent 8a1c3a4b43
commit 192921ad0f

View file

@ -117,6 +117,14 @@ StateMachine.create({
this.assignMarineLeader(parseInt(rank.pop().candidate, 0));
},
onleaveselection: function (event, from, to, voter, candidate) {
if (event === "removeGatherer" || event === "regather") {
this.gatherers.forEach(gatherer => {
gatherer.team = "lobby";
});
}
},
onbeforeconfirmSelection: function (event, from, to, leader) {
return (this.aliens().length === this.TEAM_SIZE
&& this.marines().length === this.TEAM_SIZE);