diff options
| -rw-r--r-- | crsm.cpp | 16 | ||||
| -rw-r--r-- | crsm.hpp | 1 |
2 files changed, 15 insertions, 2 deletions
@@ -612,15 +612,21 @@ void CRSM::updateNextAutoScens() { while(nextAutoScens.length() < settings["UserListLength"].toInt()) { + ScenarioSettings next(""); if(settings["RandomizeAutoHosting"] == "true") { - nextAutoScens.append(autolist.at(qrand() % autolist.length())); + next = autolist.at(qrand() % autolist.length()); } else { - nextAutoScens.append(autolist.at(current)); + next = autolist.at(current); if(++current >= autolist.length()) current = 0; } + if(next.randomLeague) + { + next.league = qrand() % 2; + } + nextAutoScens.append(next); } } @@ -795,6 +801,12 @@ void CRSM::readScenarios() scen.league = true; scen.name = argList.join(' '); } + else if(argList.first().trimmed() == "--random-league") + { + argList.removeFirst(); + scen.randomLeague = true; + scen.name = argList.join(' '); + } if(scenExists(scen.name)) { out(scen.name + "\n"); @@ -42,6 +42,7 @@ class ScenarioSettings { public: QString name; bool league = false; + bool randomLeague = false; ClientInfo wishClient; ScenarioSettings(const QString& name, bool league = false) : name(name), league(league) {} |
