GUI: Fix maximum page number calculation in grid chooser.

This avoids a off by one error in some cases.
This commit is contained in:
Johannes Schickel 2012-09-26 02:49:24 +02:00
parent bc1743b225
commit 40fb004509

View File

@ -882,7 +882,7 @@ void SaveLoadChooserGrid::updateSaves() {
}
}
const uint numPages = (_entriesPerPage != 0) ? (_saveList.size() / _entriesPerPage + 1) : 1;
const uint numPages = (_entriesPerPage != 0 && !_saveList.empty()) ? ((_saveList.size() + _entriesPerPage - 1) / _entriesPerPage) : 1;
_pageDisplay->setLabel(Common::String::format("%u/%u", _curPage + 1, numPages));
if (_curPage > 0)