From 437586e9dad478fd63a96d442ab77b744ce6fec3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 27 Jul 2018 22:48:12 +0300 Subject: Fix moving between slots in character selection dialog. --- src/gui/windows/charselectdialog.cpp | 8 ++++---- 1 file 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); -- cgit v1.2.3-70-g09d2