summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/char/enemy.c2
1 files changed, 1 insertions, 1 deletions
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);