add back to station

This commit is contained in:
quenousimporte 2025-03-30 20:15:15 +00:00
parent 635aedce92
commit 853921b79b
1 changed files with 17 additions and 4 deletions

21
w/w.c
View File

@ -92,6 +92,11 @@ void savestate()
fclose(file); fclose(file);
} }
char currentchar()
{
return charatpos(state.location.x, state.location.y);
}
void update3dpov() void update3dpov()
{ {
for (int i = 0; i < POV_3D_SIZE; i++) 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; for (int i = 5; i < 9; i++) pov3d[i][9] = doorchar;
} }
}
char currentchar() if (currentchar() == 's')
{ {
return charatpos(state.location.x, state.location.y); pov3d[0][4] = '[';
pov3d[0][5] = ']';
}
} }
void updatepov() void updatepov()
@ -376,6 +382,7 @@ void update(char command[CMD_LEN])
switch (c) switch (c)
{ {
case 's': case 's':
case '\0':
forward(); forward();
break; break;
case 'x': case 'x':
@ -384,6 +391,12 @@ void update(char command[CMD_LEN])
case 'w': case 'w':
left(); left();
break; break;
case 'r':
if (currentchar() == 's')
{
state.place = PLACE_STATION;
}
break;
default: default:
break; break;
} }