Merge pull request #370 from skyedeving/fix-evidence-loading

Sort case evidence numerically before adding in
This commit is contained in:
oldmud0 2021-01-04 23:52:25 -06:00 committed by GitHub
commit f77ae093e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;