diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2015-03-22 23:40:44 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2015-03-22 23:40:44 +0000 |
commit | bfd19395defe94e3eeb12a31af4656b12fb0e3d3 (patch) | |
tree | 8e8968c8b3f674cbb726242d3c68b867b678ff1b | |
parent | 269f812561a39e085cc33e864b82e631d8edbb87 (diff) | |
download | c-stuff-bfd19395defe94e3eeb12a31af4656b12fb0e3d3.tar.gz c-stuff-bfd19395defe94e3eeb12a31af4656b12fb0e3d3.tar.xz c-stuff-bfd19395defe94e3eeb12a31af4656b12fb0e3d3.zip |
snake.c: Additional braces to silence warnings.
-rw-r--r-- | snake.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -143,7 +143,7 @@ void redirect(enum direction desired_dir) if (desired_dir == game.snake.direction) return; - if (current->x == previous->x) + if (current->x == previous->x) { if (current->y > previous->y) { if (desired_dir == D_UP) return; @@ -151,7 +151,7 @@ void redirect(enum direction desired_dir) if (desired_dir == D_DOWN) return; } - else if (current->y == previous->y) + } else if (current->y == previous->y) { if (current->x > previous->x) { if (desired_dir == D_LEFT) return; @@ -159,6 +159,7 @@ void redirect(enum direction desired_dir) if (desired_dir == D_RIGHT) return; } + } game.snake.direction = desired_dir; } |