diff --git a/Engine.c b/Engine.c index 0229fa8..06bcb7f 100644 --- a/Engine.c +++ b/Engine.c @@ -122,12 +122,22 @@ void interact() case L_BUTTON: bookMark--; if (bookMark == -1) - bookMark = 1; + bookMark = 9; + while (!spellKnowledge[bookMark]) + { + bookMark--; + } break; case R_BUTTON: bookMark++; - if (bookMark == 2) + if (bookMark == 10) bookMark = 0; + while (!spellKnowledge[bookMark]) + { + bookMark++; + if (bookMark == 10) + bookMark = 0; + } break; case PAUSE_BUTTON: pausemenu(); diff --git a/extern.h b/extern.h index 91b2d8e..f71ce3b 100644 --- a/extern.h +++ b/extern.h @@ -18,7 +18,7 @@ extern int kaosFlag; extern int spellFlag; extern long long int savestate; -extern int spellKnowledge; +extern int spellKnowledge[10]; extern int bookMark; extern Room* menuBG; diff --git a/main.c b/main.c index 1cb3c24..47962da 100644 --- a/main.c +++ b/main.c @@ -50,7 +50,7 @@ Room* menuBG = NULL; Mix_Music* menuBGM = NULL; long long int savestate = 2; -int spellKnowledge = 2; +int spellKnowledge[10] = {1,1,0,0,0,0,0,0,0,0}; int bookMark = 0; Room** mapData = NULL;