summaryrefslogtreecommitdiffstats
path: root/src/char
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-08-19 14:51:31 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-08-19 14:51:31 (EDT)
commite08091bbf3735f04605c5bc84ad0b82ca960cbc3 (patch)
tree73a2cef67941055d4f4cd453206307d02ebb89ad /src/char
parent7a252a42c4ec1a0116f7eff5727afcda3c5aba22 (diff)
downloadmazefight-e08091bbf3735f04605c5bc84ad0b82ca960cbc3.zip
mazefight-e08091bbf3735f04605c5bc84ad0b82ca960cbc3.tar.gz
mazefight-e08091bbf3735f04605c5bc84ad0b82ca960cbc3.tar.bz2
Revert "char/enemy: Add collision avoidance"
This reverts commit 7a252a42c4ec1a0116f7eff5727afcda3c5aba22.
Diffstat (limited to 'src/char')
-rw-r--r--src/char/enemy.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/char/enemy.c b/src/char/enemy.c
index e51e440..f8e91a3 100644
--- a/src/char/enemy.c
+++ b/src/char/enemy.c
@@ -52,7 +52,6 @@ _mf_enemy_step(struct mf_char *c)
enum _mf_char_dir back;
int dx;
int dy;
- struct mf_char *o;
/* Shuffle directions */
for (i = 0; i < 4; ++i) {
@@ -90,21 +89,9 @@ _mf_enemy_step(struct mf_char *c)
/* Wall ahead; don't go this direction. */
continue;
}
- for (o = c; o != NULL; o = ((struct mf_enemy *) o)->next_enemy){
- if (o->cur_x == c->cur_x+dx && o->cur_y == c->cur_y+dy){
- /* Another enemy currently in this direction */
- goto next_dir;
- }
- if (o->new_x == c->cur_x+dx && o->new_y == c->cur_y+dy){
- /* Another enemy moving in this direction */
- goto next_dir;
- }
- }
/* Move */
c->new_dir = dirs[i];
return 0;
- next_dir:
- continue;
}
return 0;