back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/ghosts.c
diff options
context:
space:
mode:
Diffstat (limited to 'ghosts.c')
-rw-r--r--ghosts.c8
1 files changed, 4 insertions, 4 deletions
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();