home · contact · privacy
Corrected mixed up coordinates.
[plomrogue] / roguelike.c
index 2319963448077b077908e5aa4cb063f051ab729c..fc5ce007be5e4865e7b79915f52f050c66602c9c 100644 (file)
@@ -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));