From 221523f82b2e4659db34f1fb1d8c180b3c442be3 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 10 Aug 2021 01:48:55 -0400 Subject: char/enemy: Fix closeness check --- (limited to 'src/char') diff --git a/src/char/enemy.c b/src/char/enemy.c index 06ced77..ca6d8e1 100644 --- a/src/char/enemy.c +++ b/src/char/enemy.c @@ -140,7 +140,7 @@ mf_enemy_new(struct mf_maze *maze, int cell_width, int maze_size) c->eyes_color.r = MF_COLOR_EEYE_R, c->eyes_color.g = MF_COLOR_EEYE_G; c->eyes_color.b = MF_COLOR_EEYE_B, c->eyes_color.a = MF_COLOR_EEYE_A; - while (c->cur_x < maze_size * MF_ENEMY_MIN_DIST || + while (c->cur_x < maze_size * MF_ENEMY_MIN_DIST && c->cur_y < maze_size * MF_ENEMY_MIN_DIST) { c->cur_x = rand() / (RAND_MAX / maze_size); c->cur_y = rand() / (RAND_MAX / maze_size); -- cgit v0.9.1