fix error in eat_the_snake_overwrite when more moves are posible
This commit is contained in:
@@ -125,7 +125,13 @@ class BetterMasterSnake(TemplateSnake):
|
||||
|
||||
self.find_safe_positions()
|
||||
if self.eat_the_snake_overwrite:
|
||||
self.add_calculations({"function": "eat_the_snake_overwrite", "my_head": self.my_head, "move": move})
|
||||
if len(self.safe_positions) > 1:
|
||||
self.add_calculations({"function": "eat_the_snake_overwrite", "my_head": self.my_head, "move": move, "safe_positions": self.safe_positions[0]})
|
||||
self.add_to_history({"turn": game_data["turn"], "data": self.calculations})
|
||||
return self.safe_positions[0]
|
||||
|
||||
self.add_calculations({"function": "eat_the_snake_overwrite", "my_head": self.my_head, "move": move, "safe_positions": self.safe_positions})
|
||||
self.add_to_history({"turn": game_data["turn"], "data": self.calculations})
|
||||
return self.safe_positions
|
||||
|
||||
if self.game_type == "constrictor":
|
||||
|
||||
Reference in New Issue
Block a user