home
·
contact
·
privacy
projects
/
plomrogue
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
898e67b
)
Corrected what valgrind complains about.
author
Christian Heller
<c.heller@plomlompom.de>
Fri, 7 Jun 2013 22:30:50 +0000
(
00:30
+0200)
committer
Christian Heller
<c.heller@plomlompom.de>
Fri, 7 Jun 2013 22:30:50 +0000
(
00:30
+0200)
roguelike.c
patch
|
blob
|
history
diff --git
a/roguelike.c
b/roguelike.c
index 894fa59095a6c071c6b2b08ccb17b5f0763dffed..6ae524330e30f0482b0748c485ba992ccb0c394b 100644
(file)
--- 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 = 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; }
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;
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;
if (0 == world.interactive) {
unsigned char still_reading_file = 1;
int action;