|
@ -126,6 +126,8 @@ void processInput(char userInput[20]) |
|
|
} |
|
|
} |
|
|
else if (strcmp(userInput, "shop") == 0) |
|
|
else if (strcmp(userInput, "shop") == 0) |
|
|
{ |
|
|
{ |
|
|
|
|
|
lastPlayerPosition = playerPosition; //playerPosition doesn't change but lastPlayerPosition needs update |
|
|
|
|
|
|
|
|
Room actualRoom = map[playerPosition]; |
|
|
Room actualRoom = map[playerPosition]; |
|
|
if (actualRoom.shopAvailable == 1) |
|
|
if (actualRoom.shopAvailable == 1) |
|
|
{ |
|
|
{ |
|
@ -223,12 +225,12 @@ void printStatus() |
|
|
{ |
|
|
{ |
|
|
strcpy(moveMessage, "START"); |
|
|
strcpy(moveMessage, "START"); |
|
|
} |
|
|
} |
|
|
else |
|
|
|
|
|
|
|
|
else if(lastPlayerPosition == playerPosition) |
|
|
{ |
|
|
{ |
|
|
strcpy(moveMessage, "You didn't move"); |
|
|
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"); |
|
|
printf("\n\n################################################################################\n"); |
|
|
|
|
|
|
|
|