diff --git a/source/store/grid.cpp b/source/store/grid.cpp index b80757b..7f9e8ea 100644 --- a/source/store/grid.cpp +++ b/source/store/grid.cpp @@ -106,22 +106,14 @@ void StoreUtils::GridLogic(std::unique_ptr &store, std::vectorGetEntry() + 5 < (int)entries.size() - 1) { store->SetEntry(store->GetEntry() + 5); - if (entries.size() > 15) { - if (store->GetScreenIndx() < (((int)entries.size() / 5) - 2)) { - store->SetScreenIndx(store->GetScreenIndx() + 1); - } - } + if (entries.size() > 15) store->SetScreenIndx((store->GetEntry() / 5) - 2); } else { if (store->GetEntry() < (int)entries.size() - 1) { store->SetEntry(entries.size() - 1); store->SetBox(10 + (store->GetEntry() % 5)); - if (entries.size() > 15) { - if (store->GetScreenIndx() < (((int)entries.size() / 5) - 2)) { - store->SetScreenIndx(store->GetScreenIndx() + 1); - } - } + if (entries.size() > 15) store->SetScreenIndx((store->GetEntry() / 5) - 2); } } @@ -143,9 +135,7 @@ void StoreUtils::GridLogic(std::unique_ptr &store, std::vectorSetBox(10); store->SetEntry(store->GetEntry() + 1); - if (store->GetScreenIndx() < (((int)entries.size() / 5) - 2)) { - store->SetScreenIndx(store->GetScreenIndx() + 1); - } + store->SetScreenIndx((store->GetEntry() / 5) - 2); } } } @@ -160,9 +150,7 @@ void StoreUtils::GridLogic(std::unique_ptr &store, std::vectorSetBox(4); store->SetEntry(store->GetEntry() - 1); - if (store->GetScreenIndx() > 0) { - store->SetScreenIndx(store->GetScreenIndx() - 1); - } + store->SetScreenIndx((store->GetEntry() / 5)); } } } @@ -172,9 +160,7 @@ void StoreUtils::GridLogic(std::unique_ptr &store, std::vectorGetEntry() > 4) { store->SetEntry(store->GetEntry() - 5); - if (store->GetScreenIndx() > 0) { - store->SetScreenIndx(store->GetScreenIndx() - 1); - } + store->SetScreenIndx((store->GetEntry() / 5)); } } else { diff --git a/source/utils/argumentParser.cpp b/source/utils/argumentParser.cpp index 29e165e..0eec81c 100644 --- a/source/utils/argumentParser.cpp +++ b/source/utils/argumentParser.cpp @@ -37,7 +37,7 @@ int dlIndex: The Download index. */ ArgumentParser::ArgumentParser(const std::string &file, const std::string &entry, int dlIndex) { - if (dlIndex != -1 || file != "") { + if (dlIndex != -1 && file != "") { this->file = file; this->entry = entry; this->dlIndex = dlIndex;