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