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

spellbook fix pages

This commit is contained in:
Laserlicht 2024-01-01 14:57:55 +01:00 committed by GitHub
parent 4cd910a4ce
commit 9066dbcbd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -322,10 +322,10 @@ void CSpellWindow::processSpells()
sitesPerTabAdv[v] = 1; sitesPerTabAdv[v] = 1;
else else
{ {
if((sitesPerTabAdv[v] - spellsPerPage - 2) % spellsPerPage == 0) if((sitesPerTabAdv[v] - (spellsPerPage - 2)) % spellsPerPage == 0)
sitesPerTabAdv[v] = (sitesPerTabAdv[v] - spellsPerPage - 2) / spellsPerPage + 1; sitesPerTabAdv[v] = (sitesPerTabAdv[v] - (spellsPerPage - 2)) / spellsPerPage + 1;
else else
sitesPerTabAdv[v] = (sitesPerTabAdv[v] - spellsPerPage - 2) / spellsPerPage + 2; sitesPerTabAdv[v] = (sitesPerTabAdv[v] - (spellsPerPage - 2)) / spellsPerPage + 2;
} }
} }
@ -340,10 +340,10 @@ void CSpellWindow::processSpells()
sitesPerTabBattle[v] = 1; sitesPerTabBattle[v] = 1;
else else
{ {
if((sitesPerTabBattle[v] - spellsPerPage - 2) % spellsPerPage == 0) if((sitesPerTabBattle[v] - (spellsPerPage - 2)) % spellsPerPage == 0)
sitesPerTabBattle[v] = (sitesPerTabBattle[v] - spellsPerPage - 2) / spellsPerPage + 1; sitesPerTabBattle[v] = (sitesPerTabBattle[v] - (spellsPerPage - 2)) / spellsPerPage + 1;
else else
sitesPerTabBattle[v] = (sitesPerTabBattle[v] - spellsPerPage - 2) / spellsPerPage + 2; sitesPerTabBattle[v] = (sitesPerTabBattle[v] - (spellsPerPage - 2)) / spellsPerPage + 2;
} }
} }
} }