From 91583d5699503e981105beecc51d37b59dc1842e Mon Sep 17 00:00:00 2001 From: scratko Date: Fri, 12 Apr 2024 16:33:07 +0300 Subject: Coin checks Coin checks in yellow blocks and stars. Fixed arguments of find_free_directions function. --- ghosts.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ghosts.c') diff --git a/ghosts.c b/ghosts.c index ded74e7..f8edfa2 100644 --- a/ghosts.c +++ b/ghosts.c @@ -116,8 +116,8 @@ void make_ghost_moves(game_space field, static void pave_only_way(game_space field, struct ghost_type *ghost) { - struct free_directions path = find_free_directions(field, ghost->position.y, - ghost->position.x); + struct free_directions path = find_free_directions(field, ghost->position.x, + ghost->position.y); enum movement_direction reverse_direction = ghost->direction; reverse_direction ^= 1; if(path.left && left != reverse_direction) @@ -344,7 +344,7 @@ void compute_distance_between_points(game_space field, initial_point = ghost->position; min_distance = 0; struct free_directions consider_paths = - find_free_directions(field, initial_point.y, initial_point.x); + find_free_directions(field, initial_point.x, initial_point.y); if(consider_paths.right && ghost_direction != left) { changed_initial_point.x = initial_point.x + 1; changed_initial_point.y = initial_point.y; @@ -399,7 +399,7 @@ void random_redirect(game_space field, struct ghost_type *ghost) { enum movement_direction random_direction; struct free_directions paths = - find_free_directions(field, ghost->position.y, ghost->position.x); + find_free_directions(field, ghost->position.x, ghost->position.y); random_direction = get_random_direction(); while(!is_equal_directions(random_direction, paths)) random_direction = get_random_direction(); -- cgit v1.2.3