1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-01 12:57:51 +02:00

Merge pull request #227 from Chocimier/book

Prevent flipping empty spellbook
This commit is contained in:
Alexander Shishkin 2016-10-02 00:42:33 +04:00 committed by GitHub
commit a92e820eb4

View File

@ -224,7 +224,7 @@ CSpellWindow::CSpellWindow(const SDL_Rect &, const CGHeroInstance * _myHero, CPl
currentPage = battleSpellsOnly ? myInt->spellbookSettings.spellbookLastPageBattle : myInt->spellbookSettings.spellbokLastPageAdvmap;
// spellbook last page battle index is not reset after battle, so this needs to stay here
vstd::abetween(currentPage, 0, pagesWithinCurrentTab() - 1);
vstd::abetween(currentPage, 0, std::max(0, pagesWithinCurrentTab() - 1));
computeSpellsPerArea();
addUsedEvents(KEYBOARD);