From a8672bbd45e5aeaf5ff373d520885e90f622bd1c Mon Sep 17 00:00:00 2001 From: ntr Date: Tue, 27 Nov 2018 20:26:12 +1100 Subject: [PATCH] no more targeting KO cryps --- server/src/game.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/src/game.rs b/server/src/game.rs index d54c5a90..7116b832 100755 --- a/server/src/game.rs +++ b/server/src/game.rs @@ -322,10 +322,11 @@ impl Game { let team = self.team_by_id(team_id); // is the target in the team? - match team.cryp_by_id(cryp_id) { - Some(c) => c, - None => return Err(err_msg("cryp not in team")), - }; + let cryp = team.cryp_by_id(cryp_id).ok_or(err_msg("cryp not in team"))?; + + if cryp.is_ko() { + return Err(err_msg("you cannot target ko cryps")); + } } // set the target