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");