From b91c1620e41bd153824c2c598b0bc43f296b8b57 Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 11 Jan 2019 13:23:05 +1100 Subject: [PATCH] fix empty team bug --- server/WORKLOG.md | 3 ++- server/src/game.rs | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/server/WORKLOG.md b/server/WORKLOG.md index 5c276f36..beccbae7 100644 --- a/server/WORKLOG.md +++ b/server/WORKLOG.md @@ -14,7 +14,6 @@ strangle ## NOW * clean up categories -* scale down damage * why is the text fucked? * iconography * full svg buttons to not have to fuck around with text @@ -23,6 +22,8 @@ strangle ## SOON * aoe skills +* armour and SS + * keep track of games joined * concede game on leave * ko all cryps on team, check status diff --git a/server/src/game.rs b/server/src/game.rs index ceff41a4..eae146b0 100644 --- a/server/src/game.rs +++ b/server/src/game.rs @@ -673,15 +673,15 @@ pub fn game_update(game: &Game, tx: &mut Transaction) -> Result<(), Error> { } pub fn game_pve_new(cryp_ids: Vec, mode: PveMode, tx: &mut Transaction, account: &Account) -> Result { + 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::, 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)")); }