fix empty team bug
This commit is contained in:
+4
-4
@@ -673,15 +673,15 @@ pub fn game_update(game: &Game, tx: &mut Transaction) -> Result<(), Error> {
|
||||
}
|
||||
|
||||
pub fn game_pve_new(cryp_ids: Vec<Uuid>, mode: PveMode, tx: &mut Transaction, account: &Account) -> Result<Game, Error> {
|
||||
if cryp_ids.len() == 0 {
|
||||
return Err(err_msg("no cryps selected"));
|
||||
}
|
||||
|
||||
let cryps = cryp_ids
|
||||
.iter()
|
||||
.map(|id| cryp_get(tx, *id, account.id))
|
||||
.collect::<Result<Vec<Cryp>, Error>>()?;
|
||||
|
||||
if cryps.len() == 0 {
|
||||
return Err(err_msg("no cryps selected"));
|
||||
}
|
||||
|
||||
if cryps.len() > 3 {
|
||||
return Err(err_msg("team size too large (3 max)"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user