ensure map is the same during a game session

This commit is contained in:
quenousimporte 2025-04-18 16:14:41 +02:00
parent 8d4fb191c6
commit af11c8bbc1
1 changed files with 7 additions and 3 deletions

8
w/w.c
View File

@ -368,6 +368,7 @@ void updatepov()
pov[2 - frontoffset][1 + rtoloffset] = charatpos(newX, newY); pov[2 - frontoffset][1 + rtoloffset] = charatpos(newX, newY);
} }
} }
update3dpov();
} }
void forward() void forward()
@ -451,6 +452,7 @@ void clearscreen()
void init() void init()
{ {
printf("Démarrage...\n"); printf("Démarrage...\n");
map[0] = 0;
srand(time(NULL)); srand(time(NULL));
FILE* file = fopen(statepath, "r"); FILE* file = fopen(statepath, "r");
if (file) if (file)
@ -839,7 +841,10 @@ void update(char* command)
state.position.y = 13; state.position.y = 13;
state.position.orientation = NORTH; state.position.orientation = NORTH;
initmap(); if (map[0] == 0)
{
initmap();
}
updatepov(); updatepov();
} }
else if (c == CMD_GOTOMARKET) else if (c == CMD_GOTOMARKET)
@ -966,7 +971,6 @@ void draw()
} }
else if (state.screen == SC_MAP) else if (state.screen == SC_MAP)
{ {
update3dpov();
drawpov3d(); drawpov3d();
// todo: would need a compass? // todo: would need a compass?