diff options
Diffstat (limited to 'src/char/char.c')
-rw-r--r-- | src/char/char.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/char/char.c b/src/char/char.c index 97c3cc4..05ca03a 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -59,7 +59,6 @@ mf_char_get_vector(struct mf_char *c, int *x, int *y, int *travel, int mf_char_update(struct mf_char *c) { - int stepped = SDL_FALSE; int dx; int dy; @@ -70,7 +69,9 @@ mf_char_update(struct mf_char *c) /* Reached next cell */ c->cur_x = c->new_x; c->cur_y = c->new_y; - stepped = SDL_TRUE; + if (c->step(c) < 0) { + return -1; + } if (c->cur_dir == c->new_dir) { /* Want to continue straight */ c->travel -= c->cell_width; @@ -113,13 +114,11 @@ mf_char_update(struct mf_char *c) c->new_x = c->cur_x + dx; c->new_y = c->cur_y + dy; c->travel += c->speed; - } else { - stepped = SDL_TRUE; } } end: - return c->update(c, stepped); + return c->update(c); } int |