cannot clear skills while ready

This commit is contained in:
ntr 2019-12-20 13:15:40 +10:00
parent 69c964510c
commit b36b9553d0

View File

@ -336,7 +336,11 @@ impl Game {
pub fn clear_skill(&mut self, player_id: Uuid) -> Result<&mut Game, Error> {
self.player_by_id(player_id)?;
let player = self.player_by_id(player_id)?;
if player.ready {
return Err(err_msg("cannot clear skills while ready"));
}
if self.phase != Phase::Skill {
return Err(err_msg("game not in skill phase"));
}