diff --git a/w/w.c b/w/w.c index 8aceb34..c10c218 100644 --- a/w/w.c +++ b/w/w.c @@ -92,6 +92,11 @@ void savestate() fclose(file); } +char currentchar() +{ + return charatpos(state.location.x, state.location.y); +} + void update3dpov() { for (int i = 0; i < POV_3D_SIZE; i++) @@ -231,11 +236,12 @@ void update3dpov() { for (int i = 5; i < 9; i++) pov3d[i][9] = doorchar; } -} -char currentchar() -{ - return charatpos(state.location.x, state.location.y); + if (currentchar() == 's') + { + pov3d[0][4] = '['; + pov3d[0][5] = ']'; + } } void updatepov() @@ -376,6 +382,7 @@ void update(char command[CMD_LEN]) switch (c) { case 's': + case '\0': forward(); break; case 'x': @@ -384,6 +391,12 @@ void update(char command[CMD_LEN]) case 'w': left(); break; + case 'r': + if (currentchar() == 's') + { + state.place = PLACE_STATION; + } + break; default: break; }