mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
- Fixed mantis #1248
- Fixed spellbook page save positions for hotseat mode
This commit is contained in:
@ -208,9 +208,12 @@ CSpellWindow::CSpellWindow(const SDL_Rect &, const CGHeroInstance * _myHero, CPl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
selectedTab = battleSpellsOnly ? LOCPLINT->spellbookSettings.spellbookLastTabBattle : LOCPLINT->spellbookSettings.spellbookLastTabAdvmap;
|
selectedTab = battleSpellsOnly ? myInt->spellbookSettings.spellbookLastTabBattle : myInt->spellbookSettings.spellbookLastTabAdvmap;
|
||||||
currentPage = battleSpellsOnly ? LOCPLINT->spellbookSettings.spellbookLastPageBattle : LOCPLINT->spellbookSettings.spellbokLastPageAdvmap;
|
currentPage = battleSpellsOnly ? myInt->spellbookSettings.spellbookLastPageBattle : myInt->spellbookSettings.spellbokLastPageAdvmap;
|
||||||
vstd::abetween(currentPage, 0, pagesWithinCurrentTab());
|
|
||||||
|
// spellbook last page battle index is not reset after battle, so this needs to stay here
|
||||||
|
vstd::abetween(currentPage, 0, pagesWithinCurrentTab() - 1);
|
||||||
|
|
||||||
computeSpellsPerArea();
|
computeSpellsPerArea();
|
||||||
addUsedEvents(KEYBOARD);
|
addUsedEvents(KEYBOARD);
|
||||||
}
|
}
|
||||||
@ -248,8 +251,8 @@ CSpellWindow::~CSpellWindow()
|
|||||||
|
|
||||||
void CSpellWindow::fexitb()
|
void CSpellWindow::fexitb()
|
||||||
{
|
{
|
||||||
(LOCPLINT->battleInt ? LOCPLINT->spellbookSettings.spellbookLastTabBattle : LOCPLINT->spellbookSettings.spellbookLastTabAdvmap) = selectedTab;
|
(LOCPLINT->battleInt ? myInt->spellbookSettings.spellbookLastTabBattle : myInt->spellbookSettings.spellbookLastTabAdvmap) = selectedTab;
|
||||||
(LOCPLINT->battleInt ? LOCPLINT->spellbookSettings.spellbookLastPageBattle : LOCPLINT->spellbookSettings.spellbokLastPageAdvmap) = currentPage;
|
(LOCPLINT->battleInt ? myInt->spellbookSettings.spellbookLastPageBattle : myInt->spellbookSettings.spellbokLastPageAdvmap) = currentPage;
|
||||||
|
|
||||||
GH.popIntTotally(this);
|
GH.popIntTotally(this);
|
||||||
}
|
}
|
||||||
@ -868,4 +871,4 @@ void CSpellWindow::SpellArea::setSpell(SpellID spellID)
|
|||||||
const CSpell * spell = CGI->spellh->spells[mySpell];
|
const CSpell * spell = CGI->spellh->spells[mySpell];
|
||||||
schoolLevel = owner->myHero->getSpellSchoolLevel(spell, &whichSchool);
|
schoolLevel = owner->myHero->getSpellSchoolLevel(spell, &whichSchool);
|
||||||
spellCost = owner->myInt->cb->getSpellCost(spell, owner->myHero);
|
spellCost = owner->myInt->cb->getSpellCost(spell, owner->myHero);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user