ensure map is the same during a game session
This commit is contained in:
parent
8d4fb191c6
commit
af11c8bbc1
10
w/w.c
10
w/w.c
|
@ -368,6 +368,7 @@ void updatepov()
|
|||
pov[2 - frontoffset][1 + rtoloffset] = charatpos(newX, newY);
|
||||
}
|
||||
}
|
||||
update3dpov();
|
||||
}
|
||||
|
||||
void forward()
|
||||
|
@ -451,6 +452,7 @@ void clearscreen()
|
|||
void init()
|
||||
{
|
||||
printf("Démarrage...\n");
|
||||
map[0] = 0;
|
||||
srand(time(NULL));
|
||||
FILE* file = fopen(statepath, "r");
|
||||
if (file)
|
||||
|
@ -838,8 +840,11 @@ void update(char* command)
|
|||
state.position.x = 1;
|
||||
state.position.y = 13;
|
||||
state.position.orientation = NORTH;
|
||||
|
||||
initmap();
|
||||
|
||||
if (map[0] == 0)
|
||||
{
|
||||
initmap();
|
||||
}
|
||||
updatepov();
|
||||
}
|
||||
else if (c == CMD_GOTOMARKET)
|
||||
|
@ -966,7 +971,6 @@ void draw()
|
|||
}
|
||||
else if (state.screen == SC_MAP)
|
||||
{
|
||||
update3dpov();
|
||||
drawpov3d();
|
||||
|
||||
// todo: would need a compass?
|
||||
|
|
Loading…
Reference in New Issue