summaryrefslogtreecommitdiffstats
path: root/src/char
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-08-10 01:48:55 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-08-10 01:48:55 (EDT)
commit221523f82b2e4659db34f1fb1d8c180b3c442be3 (patch)
tree78110cd174a622486164294d8417b059c1f1511b /src/char
parentbef699d2c8d63ec183ac089c1d43db9f7fdfffc7 (diff)
downloadmazefight-221523f82b2e4659db34f1fb1d8c180b3c442be3.zip
mazefight-221523f82b2e4659db34f1fb1d8c180b3c442be3.tar.gz
mazefight-221523f82b2e4659db34f1fb1d8c180b3c442be3.tar.bz2
char/enemy: Fix closeness check
Diffstat (limited to 'src/char')
-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);