Mercurial > molko
diff libmlk-adventure/adventure/action/chest.c @ 298:196264679079
misc: remove usage of bool
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 10 Mar 2021 18:49:08 +0100 |
parents | 87b8c7510717 |
children | d01e83210ca2 |
line wrap: on
line diff
--- a/libmlk-adventure/adventure/action/chest.c Wed Mar 10 18:49:00 2021 +0100 +++ b/libmlk-adventure/adventure/action/chest.c Wed Mar 10 18:49:08 2021 +0100 @@ -38,7 +38,7 @@ #define H(c) ((c)->animation.sprite->cellh) #define TOLERANCE (10) -static bool +static int is_near(const struct chest *c) { const int x = c->x - c->map->player_sprite->cellw - TOLERANCE; @@ -82,13 +82,13 @@ } } -static bool +static int update(struct action *act, unsigned int ticks) { struct chest *c = act->data; if (c->state != CHEST_STATE_ANIMATE) - return false; + return 0; if (animation_update(&c->animation, ticks)) { c->state = CHEST_STATE_OPEN; @@ -97,7 +97,7 @@ c->exec(c); } - return false; + return 0; } static void @@ -130,7 +130,7 @@ assert(c); if (c->save && c->property) { - if (!save_get_property(c->save, c->property)) + if (save_get_property(c->save, c->property) < 0) panic(); /* TODO: add an utility. */