diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-07-27 22:48:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-07-27 22:48:12 +0300 |
commit | 437586e9dad478fd63a96d442ab77b744ce6fec3 (patch) | |
tree | 9774f8ab62a23e771b1670e79bae3189ad639850 /src | |
parent | 679ab7c8151b70bc9659c3ef4f16350702560a07 (diff) | |
download | manaverse-437586e9dad478fd63a96d442ab77b744ce6fec3.tar.gz manaverse-437586e9dad478fd63a96d442ab77b744ce6fec3.tar.bz2 manaverse-437586e9dad478fd63a96d442ab77b744ce6fec3.tar.xz manaverse-437586e9dad478fd63a96d442ab77b744ce6fec3.zip |
Fix moving between slots in character selection dialog.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/windows/charselectdialog.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index 1359d33e7..cc0119101 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -381,9 +381,9 @@ void CharSelectDialog::keyPressed(KeyEvent &event) int idx = mCharacterView->getSelected(); if (idx >= 0) { - idx ++; - if (idx == SLOTS_PER_ROW) + if ((idx + 1) % SLOTS_PER_ROW == 0) break; + idx ++; mCharacterView->show(idx); updateState(); } @@ -396,7 +396,7 @@ void CharSelectDialog::keyPressed(KeyEvent &event) int idx = mCharacterView->getSelected(); if (idx >= 0) { - if ((idx == 0) || idx == SLOTS_PER_ROW) + if (idx == 0 || idx % SLOTS_PER_ROW == 0) break; idx --; mCharacterView->show(idx); @@ -426,7 +426,7 @@ void CharSelectDialog::keyPressed(KeyEvent &event) int idx = mCharacterView->getSelected(); if (idx >= 0) { - if (idx >= SLOTS_PER_ROW) + if (idx >= mLoginData->characterSlots - SLOTS_PER_ROW) break; idx += SLOTS_PER_ROW; mCharacterView->show(idx); |