1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

- Fixed mantis #1248

- Fixed spellbook page save positions for hotseat mode
This commit is contained in:
beegee1 2013-11-03 18:16:25 +00:00
parent 94bee3fd1b
commit 86b7feeab3

View File

@ -208,9 +208,12 @@ CSpellWindow::CSpellWindow(const SDL_Rect &, const CGHeroInstance * _myHero, CPl
}
}
selectedTab = battleSpellsOnly ? LOCPLINT->spellbookSettings.spellbookLastTabBattle : LOCPLINT->spellbookSettings.spellbookLastTabAdvmap;
currentPage = battleSpellsOnly ? LOCPLINT->spellbookSettings.spellbookLastPageBattle : LOCPLINT->spellbookSettings.spellbokLastPageAdvmap;
vstd::abetween(currentPage, 0, pagesWithinCurrentTab());
selectedTab = battleSpellsOnly ? myInt->spellbookSettings.spellbookLastTabBattle : myInt->spellbookSettings.spellbookLastTabAdvmap;
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);
computeSpellsPerArea();
addUsedEvents(KEYBOARD);
}
@ -248,8 +251,8 @@ CSpellWindow::~CSpellWindow()
void CSpellWindow::fexitb()
{
(LOCPLINT->battleInt ? LOCPLINT->spellbookSettings.spellbookLastTabBattle : LOCPLINT->spellbookSettings.spellbookLastTabAdvmap) = selectedTab;
(LOCPLINT->battleInt ? LOCPLINT->spellbookSettings.spellbookLastPageBattle : LOCPLINT->spellbookSettings.spellbokLastPageAdvmap) = currentPage;
(LOCPLINT->battleInt ? myInt->spellbookSettings.spellbookLastTabBattle : myInt->spellbookSettings.spellbookLastTabAdvmap) = selectedTab;
(LOCPLINT->battleInt ? myInt->spellbookSettings.spellbookLastPageBattle : myInt->spellbookSettings.spellbokLastPageAdvmap) = currentPage;
GH.popIntTotally(this);
}
@ -868,4 +871,4 @@ void CSpellWindow::SpellArea::setSpell(SpellID spellID)
const CSpell * spell = CGI->spellh->spells[mySpell];
schoolLevel = owner->myHero->getSpellSchoolLevel(spell, &whichSchool);
spellCost = owner->myInt->cb->getSpellCost(spell, owner->myHero);
}
}