no team selected err msg
This commit is contained in:
parent
e1161d8ce8
commit
ef5b2acd6c
@ -86,7 +86,6 @@ class MenuNavigation extends Phaser.Scene {
|
|||||||
.setOrigin(0)
|
.setOrigin(0)
|
||||||
.on('pointerdown', () => {
|
.on('pointerdown', () => {
|
||||||
const team = this.registry.get('cryps').filter(c => c.active).map(c => c.id);
|
const team = this.registry.get('cryps').filter(c => c.active).map(c => c.id);
|
||||||
if (team.length === 0) return false;
|
|
||||||
ws.sendGamePvp(team);
|
ws.sendGamePvp(team);
|
||||||
return this.scene.restart();
|
return this.scene.restart();
|
||||||
});
|
});
|
||||||
@ -115,7 +114,6 @@ class MenuNavigation extends Phaser.Scene {
|
|||||||
.setOrigin(0)
|
.setOrigin(0)
|
||||||
.on('pointerdown', () => {
|
.on('pointerdown', () => {
|
||||||
const team = this.registry.get('cryps').filter(c => c.active).map(c => c.id);
|
const team = this.registry.get('cryps').filter(c => c.active).map(c => c.id);
|
||||||
if (team.length === 0) return false;
|
|
||||||
ws.sendGamePve(team, 'Normal');
|
ws.sendGamePve(team, 'Normal');
|
||||||
return this.scene.restart();
|
return this.scene.restart();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -678,6 +678,10 @@ pub fn game_pve_new(cryp_ids: Vec<Uuid>, mode: PveMode, tx: &mut Transaction, ac
|
|||||||
.map(|id| cryp_get(tx, *id, account.id))
|
.map(|id| cryp_get(tx, *id, account.id))
|
||||||
.collect::<Result<Vec<Cryp>, Error>>()?;
|
.collect::<Result<Vec<Cryp>, Error>>()?;
|
||||||
|
|
||||||
|
if cryps.len() == 0 {
|
||||||
|
return Err(err_msg("no cryps selected"));
|
||||||
|
}
|
||||||
|
|
||||||
if cryps.len() > 3 {
|
if cryps.len() > 3 {
|
||||||
return Err(err_msg("team size too large (3 max)"));
|
return Err(err_msg("team size too large (3 max)"));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user