From af11c8bbc1b923fa507b69e230c23ee03c39ab3f Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Fri, 18 Apr 2025 16:14:41 +0200 Subject: [PATCH] ensure map is the same during a game session --- w/w.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/w/w.c b/w/w.c index 819e06b..2a3e753 100644 --- a/w/w.c +++ b/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?