1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +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;
else
{
if((sitesPerTabAdv[v] - spellsPerPage - 2) % spellsPerPage == 0)
sitesPerTabAdv[v] = (sitesPerTabAdv[v] - spellsPerPage - 2) / spellsPerPage + 1;
if((sitesPerTabAdv[v] - (spellsPerPage - 2)) % spellsPerPage == 0)
sitesPerTabAdv[v] = (sitesPerTabAdv[v] - (spellsPerPage - 2)) / spellsPerPage + 1;
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;
else
{
if((sitesPerTabBattle[v] - spellsPerPage - 2) % spellsPerPage == 0)
sitesPerTabBattle[v] = (sitesPerTabBattle[v] - spellsPerPage - 2) / spellsPerPage + 1;
if((sitesPerTabBattle[v] - (spellsPerPage - 2)) % spellsPerPage == 0)
sitesPerTabBattle[v] = (sitesPerTabBattle[v] - (spellsPerPage - 2)) / spellsPerPage + 1;
else
sitesPerTabBattle[v] = (sitesPerTabBattle[v] - spellsPerPage - 2) / spellsPerPage + 2;
sitesPerTabBattle[v] = (sitesPerTabBattle[v] - (spellsPerPage - 2)) / spellsPerPage + 2;
}
}
}