1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Prevent flipping empty spellbook

When hero has no travel spells he can no longer flip spell book opened from right panel button
This commit is contained in:
Piotr Wójcik
2016-10-01 21:39:40 +02:00
parent 23b7a803b6
commit ea6545b1d3

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