From 885c2a806fad1b76de00e025f2550b01a27a7076 Mon Sep 17 00:00:00 2001 From: KRUGSON Date: Tue, 7 Feb 2023 15:34:50 +0100 Subject: [PATCH] updated output after shop --- src/c/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/c/main.c b/src/c/main.c index 5d72793..71b73ee 100644 --- a/src/c/main.c +++ b/src/c/main.c @@ -126,6 +126,8 @@ void processInput(char userInput[20]) } else if (strcmp(userInput, "shop") == 0) { + lastPlayerPosition = playerPosition; //playerPosition doesn't change but lastPlayerPosition needs update + Room actualRoom = map[playerPosition]; if (actualRoom.shopAvailable == 1) { @@ -223,12 +225,12 @@ void printStatus() { strcpy(moveMessage, "START"); } - else + else if(lastPlayerPosition == playerPosition) { strcpy(moveMessage, "You didn't move"); } - if (lastPlayerPosition != playerPosition || playerPosition == 0 && inputCounter == 0) + if (lastPlayerPosition != playerPosition || lastPlayerPosition == playerPosition || playerPosition == 0 && inputCounter == 0) { printf("\n\n################################################################################\n");