X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=roguelike.c;h=fc5ce007be5e4865e7b79915f52f050c66602c9c;hb=849f93dcd5195f5237bdf8324bfbac2fbf2d611c;hp=2319963448077b077908e5aa4cb063f051ab729c;hpb=71e55b8a565fe943166b186ed9c4f340977f7755;p=plomrogue diff --git a/roguelike.c b/roguelike.c index 2319963..fc5ce00 100644 --- a/roguelike.c +++ b/roguelike.c @@ -317,7 +317,7 @@ char * get_keyname(int keycode) { sprintf(keyname, "(unknown)"); return keyname; } -char is_passable (struct World * world, int y, int x) { +char is_passable (struct World * world, int x, int y) { // Check if coordinate on (or beyond) map is accessible to movement. char passable = 0; if (0 <= x && x < world->map->width && 0 <= y && y < world->map->height) @@ -350,7 +350,7 @@ void move_player (struct World * world, char d) { if (is_passable(world, world->player->x + 1, world->player->y)) { world->player->x++; success = 1; } } - if (prev == d) + if (success * d == prev) update_log (world, "."); else { char * msg = calloc(25, sizeof(char));