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

Merge pull request #295 from Chocimier/iss1293

T hotkey select first town when last is active, fixes #1293
This commit is contained in:
DjWarmonger 2017-05-13 18:22:28 +02:00 committed by GitHub
commit 1b7420264f

View File

@ -169,11 +169,10 @@ void CList::selectIndex(int which)
void CList::selectNext()
{
int index = getSelectedIndex();
if (index < 0)
selectIndex(0);
else if (index + 1 < list->size())
selectIndex(index+1);
int index = getSelectedIndex() + 1;
if (index >= list->size())
index = 0;
selectIndex(index);
}
void CList::selectPrev()