diff options
author | P. J. McDermott <pj@pehjota.net> | 2021-08-19 14:52:06 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2021-08-19 14:52:06 (EDT) |
commit | 1c86ea633eb74a0c405cc8581956a7470a5dc895 (patch) | |
tree | 44d11b11ab6be97a8a0e1773d0f21c12625d85c9 /src/char | |
parent | df2eee04d80992f4c76cb56503ee164c72d3ab32 (diff) | |
download | mazefight-1c86ea633eb74a0c405cc8581956a7470a5dc895.zip mazefight-1c86ea633eb74a0c405cc8581956a7470a5dc895.tar.gz mazefight-1c86ea633eb74a0c405cc8581956a7470a5dc895.tar.bz2 |
Revert "char/enemy: Make a linked list of enemy chars"
This reverts commit b1fbb0b1c078e82a651181101fed9d6742164e0b.
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/enemy.c | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/src/char/enemy.c b/src/char/enemy.c index a7a1251..1ac5871 100644 --- a/src/char/enemy.c +++ b/src/char/enemy.c @@ -25,20 +25,13 @@ #include "char.h" struct mf_enemy { - struct mf_char parent; - struct mf_char *next_enemy; + struct mf_char parent; }; static int -_mf_enemy_update(struct mf_char *c) +_mf_enemy_update(struct mf_char *c __attribute__((__unused__))) { - struct mf_enemy *p = (struct mf_enemy *) c; - - if (p->next_enemy != NULL) { - return mf_char_update(p->next_enemy); - } else { - return 0; - } + return 0; } static int @@ -121,28 +114,19 @@ _mf_enemy_collide(struct mf_char *c) } static int -_mf_enemy_render(struct mf_char *c, SDL_Renderer *renderer) +_mf_enemy_render(struct mf_char *c __attribute__((__unused__)), + SDL_Renderer *renderer __attribute__((__unused__))) { - struct mf_enemy *p = (struct mf_enemy *) c; - - if (p->next_enemy != NULL) { - return mf_char_render(p->next_enemy, renderer); - } else { - return 0; - } + return 0; } static void -_mf_enemy_destroy(struct mf_char *c) +_mf_enemy_destroy(struct mf_char *c __attribute__((__unused__))) { - struct mf_enemy *p = (struct mf_enemy *) c; - - mf_char_destroy(&p->next_enemy); } struct mf_char * -mf_enemy_new(struct mf_maze *maze, int cell_width, int maze_size, - struct mf_char *prev_enemy) +mf_enemy_new(struct mf_maze *maze, int cell_width, int maze_size) { struct mf_char *c; struct mf_enemy *p __attribute__((__unused__)); @@ -181,10 +165,6 @@ mf_enemy_new(struct mf_maze *maze, int cell_width, int maze_size, _mf_enemy_step(c); c->cur_dir = c->new_dir; - if (prev_enemy != NULL) { - ((struct mf_enemy *) prev_enemy)->next_enemy = c; - } - return c; } |