int old_x = getx(cave, raw_x, raw_y);
int old_y = gety(cave, raw_x, raw_y);
- store_dir(cave, x, y, GD_MV_UP, O_SPACE); // place a space ...
- store_dir(cave, old_x, old_y, move_dir, tile); // and move element.
+ // only move game element if not already moving in that direction
+ if (game_bd.game->dir_buffer_to[old_y][old_x] != move_dir)
+ {
+ store_dir(cave, x, y, GD_MV_UP, O_SPACE); // place a space ...
+ store_dir(cave, old_x, old_y, move_dir, tile); // and move element.
+ }
}
}
int old_x = getx(cave, raw_x, raw_y);
int old_y = gety(cave, raw_x, raw_y);
- store_dir(cave, x, y, GD_MV_DOWN, O_SPACE); // place a space ...
- store_dir(cave, old_x, old_y, move_dir, tile); // and move element.
+ // only move game element if not already moving in that direction
+ if (game_bd.game->dir_buffer_to[old_y][old_x] != move_dir)
+ {
+ store_dir(cave, x, y, GD_MV_DOWN, O_SPACE); // place a space ...
+ store_dir(cave, old_x, old_y, move_dir, tile); // and move element.
+ }
}
}
}