Skip to content
Snippets Groups Projects
Commit e67e970f authored by fheinrich's avatar fheinrich
Browse files

Counter interaction is not stopped on movement at all, but only if the player...

Counter interaction is not stopped on movement at all, but only if the player is not in reach anymore.
parent 8bbb78ce
No related branches found
No related tags found
1 merge request!62Resolve "Game Flow"
Pipeline #46985 passed
...@@ -704,7 +704,7 @@ class Environment: ...@@ -704,7 +704,7 @@ class Environment:
for idx, p in enumerate(self.players.values()): for idx, p in enumerate(self.players.values()):
if not (new_positions[idx] == player_positions[idx]).all(): if not (new_positions[idx] == player_positions[idx]).all():
p.pos = new_positions[idx] p.pos = new_positions[idx]
p.perform_interact_stop() # p.perform_interact_stop()
p.turn(player_movement_vectors[idx]) p.turn(player_movement_vectors[idx])
...@@ -717,6 +717,8 @@ class Environment: ...@@ -717,6 +717,8 @@ class Environment:
if facing_distances.min() <= self.player_interaction_range if facing_distances.min() <= self.player_interaction_range
else None else None
) )
if p.last_interacted_counter != p.current_nearest_counter:
p.perform_interact_stop()
def add_player(self, player_name: str, pos: npt.NDArray = None): def add_player(self, player_name: str, pos: npt.NDArray = None):
"""Add a player to the environment. """Add a player to the environment.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment