fast response with no movement option

This commit is contained in:
Max Känner 2024-10-06 21:05:45 +02:00
parent ac4c2d6f72
commit f6845b5126

View File

@ -126,7 +126,7 @@ pub fn get_move(
game.ruleset.name == "constrictor", game.ruleset.name == "constrictor",
); );
let possible_actions = board.possible_actions().get(&game_info.my_token).cloned()?; let possible_actions = board.possible_actions().get(&game_info.my_token).cloned()?;
if possible_actions.len() == 1 { if possible_actions.len() <= 1 {
info!("Only one movement option exists in turn {turn}. Skipping Tree evaluation"); info!("Only one movement option exists in turn {turn}. Skipping Tree evaluation");
return possible_actions.first().map(|direction| Action { return possible_actions.first().map(|direction| Action {
r#move: *direction, r#move: *direction,