From 7cba235a59a3316e19a61407011b5f96077c1585 Mon Sep 17 00:00:00 2001 From: "Le-Bao-Tin.Ha" <le-bao-tin.ha@insa-rennes.fr> Date: Sat, 27 Mar 2021 23:32:09 +0100 Subject: [PATCH] fix error move.c --- GAME/src/move.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GAME/src/move.c b/GAME/src/move.c index 9e10998..998ec0c 100644 --- a/GAME/src/move.c +++ b/GAME/src/move.c @@ -124,7 +124,7 @@ void prof_move(Prof *prof, int * predirection, SDL_Rect * prof_rect, MAP * map, do { randdirect = rand()%4; } - while(((randdirect == 0) && (predirection == 1)) || ((randdirect == 1) && (predirection == 0)) || ((randdirect == 2) && (predirection == 3)) || ((randdirect == 3) && (predirection == 2))); + while(((randdirect == 0) && (*predirection == 1)) || ((randdirect == 1) && (*predirection == 0)) || ((randdirect == 2) && (*predirection == 3)) || ((randdirect == 3) && (*predirection == 2))); *predirection = randdirect; break; } -- GitLab