mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +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; | ||||
| 	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); | ||||
| } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user