Sort case evidence numerically before adding in

inventories get displayed lexigraphically too but it is assumed to not
matter
This commit is contained in:
Skye Deving 2021-01-04 19:49:40 -06:00
parent 4d02cc8d68
commit 5abc685b47
2 changed files with 10 additions and 1 deletions

View File

@ -58,6 +58,7 @@
#include <QTextCharFormat>
//#include <QRandomGenerator>
#include <algorithm>
#include <stack>
class AOApplication;

View File

@ -3588,7 +3588,15 @@ void Courtroom::on_ooc_return_pressed()
new AOPacket("DE#" + QString::number(i) + "#%"));
}
foreach (QString evi, casefile.childGroups()) {
// sort the case_evidence numerically
QStringList case_evidence = casefile.childGroups();
std::sort(case_evidence.begin(), case_evidence.end(),
[] (const QString &a, const QString &b) {
return a.toInt() < b.toInt();
});
// load evidence
foreach (QString evi, case_evidence) {
if (evi == "General")
continue;