X-Git-Url: https://plomlompom.com/repos/test.html?a=blobdiff_plain;f=roguelike.c;h=6ae524330e30f0482b0748c485ba992ccb0c394b;hb=9719816eebca3b914d530a751bff6ab3cd7f0daf;hp=894fa59095a6c071c6b2b08ccb17b5f0763dffed;hpb=20473b02ae7964d25bbe0e2aaf56b64ce5c67ddc;p=plomrogue
diff --git a/roguelike.c b/roguelike.c
index 894fa59..6ae5243 100644
--- a/roguelike.c
+++ b/roguelike.c
@@ -109,9 +109,9 @@ struct Map init_map () {
curpos = y * map.width + x;
if ('~' == map.cells[curpos] &&
( (curpos >= map.width && '.' == map.cells[curpos - map.width])
- || (curpos < map.width * (map.height - 1) && '.' == map.cells[curpos + map.width])
- || (curpos > 0 && '.' == map.cells[curpos - 1] && curpos % map.width != 0)
- || (curpos < (map.width * map.height) && '.' == map.cells[curpos + 1] && (curpos + 1) % map.width != 0)))
+ || (curpos < map.width * (map.height-1) && '.' == map.cells[curpos + map.width])
+ || (curpos > 0 && curpos % map.width != 0 && '.' == map.cells[curpos-1])
+ || (curpos < (map.width * map.height) && (curpos+1) % map.width != 0 && '.' == map.cells[curpos+1])))
map.cells[y * map.width + x] = '.'; }
return map; }
@@ -348,7 +348,7 @@ int main (int argc, char *argv[]) {
toggle_window(&win_meta, &win_log);
int key;
- unsigned char quit_called;
+ unsigned char quit_called = 0;
if (0 == world.interactive) {
unsigned char still_reading_file = 1;
int action;